-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Description
Question
I saw the wait_us() in mbed_wait_api_rtos.cpp
const ticker_data_t *const ticker = get_us_ticker_data();
uint32_t start = ticker_read(ticker);
// Use the RTOS to wait for millisecond delays if possible
int ms = us / 1000;
if ((ms > 0) && core_util_are_interrupts_enabled()) {
sleep_manager_lock_deep_sleep();
Thread::wait((uint32_t)ms);
sleep_manager_unlock_deep_sleep();
}
// Use busy waiting for sub-millisecond delays, or for the whole
// interval if interrupts are not enabled
while ((ticker_read(ticker) - start) < (uint32_t)us);
Why need lock deep sleep?
@c1728p9
Metadata
Metadata
Assignees
Labels
No labels