AP_Scheduler: corrected tick counter overflow handling, fixes #17642
This commit is contained in:
parent
ba94d8839f
commit
c544f3dd01
@ -160,7 +160,7 @@ void AP_Scheduler::run(uint32_t time_available)
|
||||
for (uint8_t i=0; i<_num_tasks; i++) {
|
||||
const AP_Scheduler::Task& task = (i < _num_unshared_tasks) ? _tasks[i] : _common_tasks[i - _num_unshared_tasks];
|
||||
|
||||
uint32_t dt = _tick_counter - _last_run[i];
|
||||
const uint16_t dt = _tick_counter - _last_run[i];
|
||||
// we allow 0 to mean loop rate
|
||||
uint32_t interval_ticks = (is_zero(task.rate_hz) ? 1 : _loop_rate_hz / task.rate_hz);
|
||||
if (interval_ticks < 1) {
|
||||
|
Loading…
Reference in New Issue
Block a user