Browse Source

MillisTimer off by 2ms...

When you do a timer.begin(650) it actually triggered 652 ms from your current time.  Did minimal update to see if delay time < 2 set to zero else decrement by 2...
teensy4-core
Kurt Eckhardt 7 years ago
parent
commit
36958c5243
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      teensy3/EventResponder.cpp

+ 2
- 2
teensy3/EventResponder.cpp View File

if (_state != TimerOff) end(); if (_state != TimerOff) end();
if (!milliseconds) return; if (!milliseconds) return;
_event = &event; _event = &event;
_ms = milliseconds;
_ms = (milliseconds > 2)? milliseconds-2 : 0;
_reload = 0; _reload = 0;
addToWaitingList(); addToWaitingList();
} }
if (_state != TimerOff) end(); if (_state != TimerOff) end();
if (!milliseconds) return; if (!milliseconds) return;
_event = &event; _event = &event;
_ms = milliseconds;
_ms = (milliseconds > 2)? milliseconds-2 : 0;
_reload = milliseconds; _reload = milliseconds;
addToWaitingList(); addToWaitingList();
} }

Loading…
Cancel
Save