Control multiple device using Timer

ESP_Sprite
Posts: 9739
Joined: Thu Nov 26, 2015 4:08 am

Re: Control multiple device using Timer

Postby ESP_Sprite » Tue Sep 05, 2023 1:24 pm

Trupal wrote:
Tue Sep 05, 2023 6:48 am

I can not call esp_timer_start_periodic(); function in my Task So where It will be called?
Why can't you?

Trupal
Posts: 19
Joined: Wed Aug 16, 2023 10:54 am

Re: Control multiple device using Timer

Postby Trupal » Wed Sep 06, 2023 3:08 am

ESP_Sprite wrote:
Tue Sep 05, 2023 1:24 pm
Trupal wrote:
Tue Sep 05, 2023 6:48 am

I can not call esp_timer_start_periodic(); function in my Task So where It will be called?
Why can't you?
Because It trigger watchdog timer if I call the esp_timer_start_periodic(); function

I also tried one thing I have called My timer function when Channel is given but at that time Only one device is on and if I try to given power to another device then It reflects in first device (second device timer is also different). I have do this only for 2 channel right now but I have control 8 channel more. It should be possible or not ? If Yes then How ?

I have attached main file please have a look and please tell me is there any other way...
Attachments
main.c
(10.57 KiB) Downloaded 372 times

ESP_Sprite
Posts: 9739
Joined: Thu Nov 26, 2015 4:08 am

Re: Control multiple device using Timer

Postby ESP_Sprite » Wed Sep 06, 2023 6:37 am

You're doing some stuff that is potentially pretty long-lasting in that timer callback. Timer callbacks are serialized, so it can be that you're 'holding the queue' for other events, potentially ones that the OS needs.

Trupal
Posts: 19
Joined: Wed Aug 16, 2023 10:54 am

Re: Control multiple device using Timer

Postby Trupal » Wed Sep 06, 2023 7:00 am

ESP_Sprite wrote:
Wed Sep 06, 2023 6:37 am
You're doing some stuff that is potentially pretty long-lasting in that timer callback. Timer callbacks are serialized, so it can be that you're 'holding the queue' for other events, potentially ones that the OS needs.
Sorry but I can not understand what you are trying to say !

Trupal
Posts: 19
Joined: Wed Aug 16, 2023 10:54 am

Re: Control multiple device using Timer

Postby Trupal » Tue Sep 19, 2023 5:08 am

ESP_Sprite wrote:
Wed Sep 06, 2023 6:37 am
You're doing some stuff that is potentially pretty long-lasting in that timer callback. Timer callbacks are serialized, so it can be that you're 'holding the queue' for other events, potentially ones that the OS needs.
I have controlled the 3 devices in the mentioned file, but the problem has arrived is that the device is transferring power to the other device. I cannot find the reason for transformation !


Thank you
Attachments
main.c
(11.55 KiB) Downloaded 200 times

Who is online

Users browsing this forum: Baidu [Spider] and 129 guests