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 Francisco Ferreira
parent 23532bf45c
commit ee6969939b

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);
}