HAL_SITL: don't run IO at more than 100Hz

save some CPU for faster frame rates
This commit is contained in:
Andrew Tridgell 2017-10-21 11:57:05 +11:00
parent 4ed02c3c94
commit 7def86ae96
2 changed files with 5 additions and 1 deletions

View File

@ -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

View File

@ -73,5 +73,6 @@ private:
bool _initialized;
uint64_t _stopped_clock_usec;
uint64_t _last_io_run;
};
#endif // CONFIG_HAL_BOARD