Sub: fix underflow in scheduler

4eee3b1317 fixed this in Copter
This commit is contained in:
Peter Barker 2017-07-30 14:59:05 +10:00 committed by Andrew Tridgell
parent da425c008c
commit 4064a23b30
1 changed files with 1 additions and 1 deletions

View File

@ -147,7 +147,7 @@ void Sub::loop()
// the first call to the scheduler they won't run on a later
// call until scheduler.tick() is called again
uint32_t time_available = (timer + MAIN_LOOP_MICROS) - micros();
scheduler.run(time_available);
scheduler.run(time_available > MAIN_LOOP_MICROS ? 0u : time_available);
}