Copter: fix underflow in scheduler

If fast_loop method executed time is over MAIN_LOOP_MICROS,
scheduler.run method set value is  0.
This commit is contained in:
murata 2016-08-05 23:16:13 +09:00 committed by Lucas De Marchi
parent 0ed5665193
commit 4eee3b1317

View File

@ -238,7 +238,7 @@ void Copter::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);
}