Skip to content

Commit

Permalink
🎨 (tests): on device - small clean ups
Browse files Browse the repository at this point in the history
  • Loading branch information
ladislas committed Nov 25, 2022
1 parent 99c5c01 commit f0b10fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 0 additions & 3 deletions tests/functional/tests/deep_sleep_log_kit/suite_log_kit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ using namespace boost::ut;
using namespace std::chrono;
using namespace boost::ut::bdd;

// ? tests inspired from https://github.com/ARMmbed/mbed-os
// ? https://github.com/ARMmbed/mbed-os/blob/master/hal/tests/TESTS/mbed_hal/sleep/main.cpp

suite suite_log_kit = [] {
rtos::ThisThread::sleep_for(2000ms);

Expand Down
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 f0b10fe

Please sign in to comment.