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.33k stars 243 forks source link

Declare tStart and tFinish #180

Closed schlimmchen closed 10 months ago

schlimmchen commented 10 months ago

the variables tStart and tFinish are required if sleep support is enabled, independent of _TASK_TIMECRITICAL. however, they were guarded by _TASK_TIMECRITICAL as well.

this bug prevents building Scheduler_example19_Dynamic_Tasks_SelfDestruct.ino in particular.

arkhipenko commented 10 months ago

Pushed into testing branch as v3.8.4

schlimmchen commented 10 months ago

Thanks for looking at this PR and adopting it :blush:

I saw you implemented the fix slightly differently. Just as an FYI I'd like to point out that tIdleStart is only used if both _TASK_TIMECRITICAL and _TASK_SLEEP_ON_IDLE_RUN are defined. However, tIdleStart is now declared already if only _TASK_TIMECRITICAL is defined. There will be a compiler warning (if -Wall or -Wunsued-variable is used) for users who only enable _TASK_SLEEP_ON_IDLE_RUN.

arkhipenko commented 10 months ago

Thanks for the comment. I will look into it!