diff --git a/libraries/AP_HAL_SITL/Scheduler.cpp b/libraries/AP_HAL_SITL/Scheduler.cpp index 6228d37214..4201cf4e76 100644 --- a/libraries/AP_HAL_SITL/Scheduler.cpp +++ b/libraries/AP_HAL_SITL/Scheduler.cpp @@ -215,7 +215,10 @@ void Scheduler::_run_io_procs(bool called_from_isr) void Scheduler::stop_clock(uint64_t time_usec) { _stopped_clock_usec = time_usec; - _run_io_procs(false); + if (time_usec - _last_io_run > 10000) { + _last_io_run = time_usec; + _run_io_procs(false); + } } #endif diff --git a/libraries/AP_HAL_SITL/Scheduler.h b/libraries/AP_HAL_SITL/Scheduler.h index b1bce958a8..14595243cd 100644 --- a/libraries/AP_HAL_SITL/Scheduler.h +++ b/libraries/AP_HAL_SITL/Scheduler.h @@ -73,5 +73,6 @@ private: bool _initialized; uint64_t _stopped_clock_usec; + uint64_t _last_io_run; }; #endif // CONFIG_HAL_BOARD