File tree Expand file tree Collapse file tree 4 files changed +11
-3
lines changed Expand file tree Collapse file tree 4 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 11# Task Scheduler
22### Cooperative multitasking for Arduino, ESPx, STM32 and other microcontrollers
3- #### Version 4.0.2 : 2025-10-09 [ Latest updates] ( https://github.com/arkhipenko/TaskScheduler/wiki/Latest-Updates )
3+ #### Version 4.0.3 : 2025-11-02 [ Latest updates] ( https://github.com/arkhipenko/TaskScheduler/wiki/Latest-Updates )
44
55[ ![ arduino-library-badge] ( https://www.ardu-badge.com/badge/TaskScheduler.svg? )] ( https://www.ardu-badge.com/TaskScheduler )
66
Original file line number Diff line number Diff line change 1616 "maintainer" : true
1717 }
1818 ],
19- "version" : " 4.0.2 " ,
19+ "version" : " 4.0.3 " ,
2020 "frameworks" : " arduino" ,
2121 "platforms" : " *"
2222}
Original file line number Diff line number Diff line change 11name =TaskScheduler
2- version =4.0.2
2+ version =4.0.3
33author =Anatoli Arkhipenko <arkhipenko@hotmail.com>
44maintainer =Anatoli Arkhipenko <arkhipenko@hotmail.com>
55sentence =Cooperative multitasking for Arduino, ESPx, STM32 and other microcontrollers.
Original file line number Diff line number Diff line change @@ -300,6 +300,9 @@ v4.0.2:
300300 2025-10-09:
301301 - added unit test for _TASK_THREAD_SAFE functionality
302302
303+ v4.0.3:
304+ 2025-11-02:
305+ - bug: next execution time with _TASK_TICKLESS did not take task timeout into account
303306*/
304307
305308#include " TaskSchedulerDeclarations.h"
@@ -1674,6 +1677,11 @@ bool Scheduler::execute() {
16741677 unsigned long nextrun = iCurrent->iDelay + iCurrent->iPreviousMillis ;
16751678 // nextrun should be after current millis() (except rollover)
16761679 // nextrun should be sooner than previously determined
1680+ #ifdef _TASK_TIMEOUT
1681+ // in case timeout is set - we have to consider it as well
1682+ unsigned long untilto = iCurrent->untilTimeout () + iCurrent->iPreviousMillis ;
1683+ if ( untilto < nextrun ) nextrun = untilto;
1684+ #endif // _TASK_TIMEOUT
16771685 if ( nextrun > m && nextrun < nr ) {
16781686 nr = nextrun;
16791687 nrd |= _TASK_NEXTRUN_TIMED; // next run timed
You can’t perform that action at this time.
0 commit comments