Skip to content

Commit b22cef0

Browse files
pabigotcarlescufi
authored andcommitted
tests: kernel: timer_api: compensate for fast clocks
When HFCLK has a slew making it faster than LFCLK the busy wait can expire before the timer fires. Signed-off-by: Peter Bigot <[email protected]>
1 parent 365fd52 commit b22cef0

File tree

1 file changed

+3
-1
lines changed
  • tests/kernel/timer/timer_api/src

1 file changed

+3
-1
lines changed

tests/kernel/timer/timer_api/src/main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,9 @@ void test_timer_period_0(void)
204204
busy_wait_ms(DURATION + 1);
205205

206206
/** TESTPOINT: ensure it is one-short timer */
207-
TIMER_ASSERT(tdata.expire_cnt == 1, &period0_timer);
207+
TIMER_ASSERT((tdata.expire_cnt == 1)
208+
|| (INEXACT_MS_CONVERT
209+
&& (tdata.expire_cnt == 0)), &period0_timer);
208210
TIMER_ASSERT(tdata.stop_cnt == 0, &period0_timer);
209211

210212
/* cleanup environemtn */

0 commit comments

Comments
 (0)