Skip to content

Commit 6db028c

Browse files
committed
v4.0.3: fixed bug in _TASK_TICKLESS mode
1 parent 2a1e694 commit 6db028c

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"maintainer": true
1717
}
1818
],
19-
"version": "4.0.2",
19+
"version": "4.0.3",
2020
"frameworks": "arduino",
2121
"platforms": "*"
2222
}

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=TaskScheduler
2-
version=4.0.2
2+
version=4.0.3
33
author=Anatoli Arkhipenko <arkhipenko@hotmail.com>
44
maintainer=Anatoli Arkhipenko <arkhipenko@hotmail.com>
55
sentence=Cooperative multitasking for Arduino, ESPx, STM32 and other microcontrollers.

src/TaskScheduler.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)