@@ -34,6 +34,7 @@ using utest::v1::Case;
34
34
using utest::v1::Specification;
35
35
using utest::v1::Harness;
36
36
37
+ #if DEVICE_LPTICKER
37
38
/* Make sure there are enough ticks to cope with more than SLEEP_DURATION_US sleep
38
39
* without hitting the wrap-around.
39
40
*/
@@ -53,6 +54,7 @@ void wraparound_lp_protect(void)
53
54
54
55
while (get_lp_ticker_data ()->interface ->read () > (max_count - delta_ticks));
55
56
}
57
+ #endif
56
58
57
59
void test_lock_unlock ()
58
60
{
@@ -82,8 +84,6 @@ void test_lock_eq_ushrt_max()
82
84
TEST_ASSERT_TRUE (sleep_manager_can_deep_sleep ());
83
85
}
84
86
85
- #if DEVICE_LPTICKER
86
- #if DEVICE_USTICKER
87
87
utest::v1::status_t testcase_setup (const Case *const source, const size_t index_of_case)
88
88
{
89
89
// Suspend the RTOS kernel scheduler to prevent interference with duration of sleep.
@@ -94,12 +94,11 @@ utest::v1::status_t testcase_setup(const Case *const source, const size_t index_
94
94
// Suspend the low power ticker wrapper to prevent interference with deep sleep lock.
95
95
lp_ticker_wrapper_suspend ();
96
96
#endif
97
+ lp_ticker_init ();
97
98
#endif
98
-
99
+ # if DEVICE_USTICKER
99
100
// Make sure HAL tickers are initialized.
100
101
us_ticker_init ();
101
- #if DEVICE_LPTICKER
102
- lp_ticker_init ();
103
102
#endif
104
103
105
104
return utest::v1::greentea_case_setup_handler (source, index_of_case);
@@ -117,6 +116,8 @@ utest::v1::status_t testcase_teardown(const Case *const source, const size_t pas
117
116
return utest::v1::greentea_case_teardown_handler (source, passed, failed, failure);
118
117
}
119
118
119
+ #if DEVICE_LPTICKER
120
+ #if DEVICE_USTICKER
120
121
/* This test is based on the fact that the high-speed clocks are turned off
121
122
* in deep sleep mode but remain on in the ordinary sleep mode. Low-speed
122
123
* clocks stay on for both sleep and deep sleep modes.
0 commit comments