We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 180eb75 commit 5e29db6Copy full SHA for 5e29db6
rtos/source/ThisThread.cpp
@@ -221,9 +221,12 @@ void ThisThread::sleep_for(uint32_t millisec)
221
void ThisThread::sleep_for(Clock::duration_u32 rel_time)
222
{
223
#if MBED_CONF_RTOS_PRESENT
224
- osStatus_t status = osDelay(rel_time.count());
225
- MBED_ASSERT(status == osOK);
226
- (void) status;
+ uint32_t delay = rel_time.count();
+ if (delay != 0) {
+ osStatus_t status = osDelay(delay);
227
+ MBED_ASSERT(status == osOK);
228
+ (void) status;
229
+ }
230
#else
231
thread_sleep_for(rel_time.count());
232
#endif
0 commit comments