File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
TESTS/mbedmicro-rtos-mbed/idle_loop Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -31,15 +31,19 @@ void idle_loop_test_sleep_ms_callback(timestamp_t *time_ms)
31
31
{
32
32
LowPowerTimer timer;
33
33
timer.start ();
34
+ const uint64_t kernel_tick_start = osKernelGetTickCount ();
34
35
Thread::wait (*time_ms);
35
36
const timestamp_t end = timer.read_ms ();
37
+ const uint64_t kernel_tick_end = osKernelGetTickCount ();
36
38
37
39
// this does not test accurancy for waking up
38
40
// just that we are with some margin awake (10ms)
39
41
// sleep/low power ticker will test this
40
42
// Note: if this does not work, we wake up with
41
43
// default freq - 1ms
42
44
TEST_ASSERT_UINT32_WITHIN (3 , *time_ms, end);
45
+ uint64_t kernel_ticks_expected = (uint64_t )*time_ms * osKernelGetTickFreq () * 1000UL ;
46
+ TEST_ASSERT_UINT32_WITHIN (3 , kernel_ticks_expected, kernel_tick_end - kernel_tick_start);
43
47
}
44
48
45
49
template <timestamp_t time_ms>
You can’t perform that action at this time.
0 commit comments