Skip to content

Commit

Permalink
🎨 (tests): on device - deep sleep hal clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
ladislas committed Nov 25, 2022
1 parent 99c5c01 commit 4072085
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/functional/tests/deep_sleep_mbed_hal/suite_mbed_hal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,19 +128,20 @@ suite suite_mbed_hal = [] {

mbed_sleep();

#if MBED_CONF_TARGET_LPTICKER_LPTIM

// ? On some targets like STM family boards with LPTIM enabled an interrupt is triggered on counter
// ? rollover. We need special handling for cases when next_match_timestamp < start_timestamp (interrupt
// ? is to be fired after rollover). In such case after first wake-up we need to reset interrupt and go
// ? back to sleep waiting for the valid one. NOTE: Above comment (CMPOK) applies also here.
#if MBED_CONF_TARGET_LPTICKER_LPTIM

if ((next_match_timestamp < start_timestamp) && lp_ticker_read() < next_match_timestamp) {
lp_ticker_set_interrupt(next_match_timestamp);
wait_ns(200000);
mbed_sleep();
}

#endif
#endif // MBED_CONF_TARGET_LPTICKER_LPTIM

const timestamp_t wakeup_timestamp = lp_ticker_read();

Expand Down

0 comments on commit 4072085

Please sign in to comment.