aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatoli Arkhipenko <arkhipenko@hotmail.com>2015-11-28 23:29:00 -0500
committerAnatoli Arkhipenko <arkhipenko@hotmail.com>2015-11-28 23:29:00 -0500
commit07dcd1b4c186d849c9a9e1e0f8689f499ce911d7 (patch)
treeb9d76be2e87be4ae3370863bb32a94b435a5923b
parentc07b4b58921bd3e6d91d8195809fadf292fc80a1 (diff)
parent08a0ee9dc843dafc374e6fcbe9ffb46d8d0ba8f5 (diff)
Merge pull request #10 from JimF42/master
Obsoleted _TASK_ROLLOVER_FIX
-rw-r--r--src/TaskScheduler.h22
1 files changed, 2 insertions, 20 deletions
diff --git a/src/TaskScheduler.h b/src/TaskScheduler.h
index 1b8ab18..3b964ee 100644
--- a/src/TaskScheduler.h
+++ b/src/TaskScheduler.h
@@ -620,27 +620,9 @@ void Scheduler::execute() {
}
#endif
p = iCurrent->iPreviousMillis;
-
- // Determine when current task is supposed to run
- // Once every 47 days there is a rollover execution which will occur due to millis and targetMillis rollovers
- // That is why there is an option to compile with rollover fix
- // Example
- // iPreviousMillis = 65000
- // iInterval = 600
- // millis() = 65500
- // targetMillis = 65000 + 600 = (should be 65600) 65 (due to rollover)
- // so 65 < 65500. should be 65600 > 65500. - task will be scheduled incorrectly
- // since targetMillis (65) < iPreviousMillis (65000), rollover fix kicks in:
- // iPreviousMillis(65000) > millis(65500) - iInterval(600) = 64900 - task will not be scheduled
-
+
targetMillis = p + i;
- #ifdef _TASK_ROLLOVER_FIX
- if ( targetMillis < p ) { // targetMillis rolled over!
- if ( p > ( m - i) ) break;
- }
- else
- #endif
- if ( targetMillis > m ) break;
+ if ( m - p < i ) break;
#ifdef _TASK_TIMECRITICAL
// Updated_previous+current interval should put us into the future, so iOverrun should be positive or zero.