diff --git a/rtos/source/ThisThread.cpp b/rtos/source/ThisThread.cpp index b5c0037..8b8bf3b 100644 --- a/rtos/source/ThisThread.cpp +++ b/rtos/source/ThisThread.cpp @@ -221,9 +221,12 @@ void ThisThread::sleep_for(Clock::duration_u32 rel_time) { #if MBED_CONF_RTOS_PRESENT - osStatus_t status = osDelay(rel_time.count()); - MBED_ASSERT(status == osOK); - (void) status; + uint32_t delay = rel_time.count(); + if (delay != 0) { + osStatus_t status = osDelay(delay); + MBED_ASSERT(status == osOK); + (void) status; + } #else thread_sleep_for(rel_time.count()); #endif