arkhipenko / TaskScheduler

Cooperative multitasking for Arduino, ESPx, STM32, nRF and other microcontrollers
http://playground.arduino.cc/Code/TaskScheduler
BSD 3-Clause "New" or "Revised" License
1.26k stars 230 forks source link

Power save/idle mode not working longer term? #62

Closed David4x closed 6 years ago

David4x commented 6 years ago

Firstly well done putting TaskScheduler together, looks powerful.

I tried your example 1 and added definition for task sleep on idle to confirm lower power consumption was possible.

It appears to be switching between normal power and power save initially but after task 2 ran a few times after task 3 was disabled it appears to never switch to idle and power is never reduced. I even increased task 2 to 5 seconds which should have made this even clearer.

I also tried example 18 but this does seem to work.

Perhaps the bug is related to finite duration tasks, task disable or deleteTask?

GitMoDu commented 6 years ago

Can you post an example code to replicate that behaviour? Seems odd.

David4x commented 6 years ago

It was just example 1 but sorry false alarm I realised I placed the definition after the include rather than before as it should have been...

`#define _TASK_SLEEP_ON_IDLE_RUN

include `

NOT

`#include

define _TASK_SLEEP_ON_IDLE_RUN`

arkhipenko commented 6 years ago

I love self-resolving issues!

:))))

On Aug 30, 2018 6:50 AM, David4x notifications@github.com wrote:

Closed #62https://github.com/arkhipenko/TaskScheduler/issues/62.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/arkhipenko/TaskScheduler/issues/62#event-1817880183, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AATGTcNNGI_H-6bd1iS-jjbbGfeaKCs4ks5uV8OQgaJpZM4WSsuO.