Пример #1
0
void lp_ticker_sleep_until(uint32_t now, uint32_t time)
{
    lp_ticker_set_interrupt(now, time);
    sleep_t sleep_obj;
    mbed_enter_sleep(&sleep_obj);
    mbed_exit_sleep(&sleep_obj);
}
Пример #2
0
void lp_ticker_sleep_until(uint32_t now, uint32_t time)
{
    lp_ticker_set_interrupt(now, time);
    sleep_t sleep_obj;
    mbed_enter_sleep(&sleep_obj);
    // if LPTMR is running and we scheduled it, we know that RTC was fired while
    // we were sleeping
    if (LPTMR_HAL_IsEnabled(LPTMR0_BASE) && lp_ticker_lptmr_scheduled_flag) {
        __WFI();
    }
    mbed_exit_sleep(&sleep_obj);
}
void sleep(){
    sleep_t sleep_obj;
    mbed_enter_sleep(&sleep_obj);
    mbed_exit_sleep(&sleep_obj);
}