diff options
| author | Anatoli Arkhipenko <arkhipenko@hotmail.com> | 2015-09-22 21:34:41 -0400 |
|---|---|---|
| committer | Anatoli Arkhipenko <arkhipenko@hotmail.com> | 2015-09-22 21:34:41 -0400 |
| commit | 82bd27b8924523e40fcf4383437303a814784da2 (patch) | |
| tree | f18c9c65f120075b28ddfe3646b2db5fe9afa31d /TaskScheduler.cpp | |
| parent | 5d6cb5f626bd2b692071f4fe13a281fb15a45cd0 (diff) | |
| parent | 85887bbafa7f9494d4f736cc4f1ec065062c6dd0 (diff) | |
Merge pull request #2 from arkhipenko/disable-on-last-iteration
Adding "Always disable on last iteration" to master
Diffstat (limited to 'TaskScheduler.cpp')
| -rw-r--r-- | TaskScheduler.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/TaskScheduler.cpp b/TaskScheduler.cpp index 317b70c..924b40e 100644 --- a/TaskScheduler.cpp +++ b/TaskScheduler.cpp @@ -1,4 +1,4 @@ -// Cooperative multitasking library for Arduino version 1.51 +// Cooperative multitasking library for Arduino version 1.6 // Copyright (c) 2015 Anatoli Arkhipenko // @@ -50,7 +50,6 @@ void Task::reset() { iPrev = NULL; iNext = NULL; iScheduler = NULL; - iDisableOnLastIteration = false; #ifdef _TASK_TIMECRITICAL iOverrun = 0; #endif @@ -63,7 +62,6 @@ void Task::reset() { */ void Task::set(unsigned long aInterval, long aIterations, void (*aCallback)()) { iInterval = aInterval; - if (iEnabled && iIterations == 0) enable(); iSetIterations = iIterations = aIterations; iCallback = aCallback; } @@ -73,7 +71,6 @@ void Task::set(unsigned long aInterval, long aIterations, void (*aCallback)()) { * @param aIterations - number of iterations, use -1 for no limit */ void Task::setIterations(long aIterations) { - if (iEnabled && iIterations == 0) enable(); iSetIterations = iIterations = aIterations; } @@ -240,7 +237,7 @@ void Scheduler::execute() { do { if (iCurrent->iEnabled) { if (iCurrent->iIterations == 0) { - if (iCurrent->iDisableOnLastIteration) iCurrent->disable(); + iCurrent->disable(); break; } if (iCurrent->iInterval > 0) { |
