diff --git a/libraries/AP_HAL_SITL/Scheduler.cpp b/libraries/AP_HAL_SITL/Scheduler.cpp index c925a0ca5b..12a77a8d0c 100644 --- a/libraries/AP_HAL_SITL/Scheduler.cpp +++ b/libraries/AP_HAL_SITL/Scheduler.cpp @@ -128,6 +128,11 @@ bool Scheduler::semaphore_wait_hack_required() const void Scheduler::delay_microseconds(uint16_t usec) { + if (_sitlState->_sitl == nullptr) { + // this allows examples to run + hal.scheduler->stop_clock(AP_HAL::micros64()+usec); + return; + } uint64_t start = AP_HAL::micros64(); do { uint64_t dtime = AP_HAL::micros64() - start;