MCPcopy Create free account
hub / github.com/ArduPilot/ardupilot / delay

Method delay

libraries/AP_HAL_ChibiOS/Scheduler.cpp:228–243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226}
227
228void Scheduler::delay(uint16_t ms)
229{
230 uint64_t start = AP_HAL::micros64();
231
232 while ((AP_HAL::micros64() - start)/1000 < ms) {
233 delay_microseconds(1000);
234 if (_min_delay_cb_ms <= ms) {
235 if (in_main_thread()) {
236 const auto old_task = hal.util->persistent_data.scheduler_task;
237 hal.util->persistent_data.scheduler_task = -4;
238 call_delay_cb();
239 hal.util->persistent_data.scheduler_task = old_task;
240 }
241 }
242 }
243}
244
245void Scheduler::register_timer_process(AP_HAL::MemberProc proc)
246{

Callers 7

flash_bootloaderMethod · 0.45
_monitor_threadMethod · 0.45
test_clock_freqMethod · 0.45
panicFunction · 0.45
_save_backupMethod · 0.45
_flash_write_dataMethod · 0.45
_flash_erase_sectorMethod · 0.45

Calls 1

micros64Function · 0.70

Tested by 1

test_clock_freqMethod · 0.36