tests: kernel: timer_api: use slew for duration timer test

Reduce the duration of the timer test so that it will fire before the
busywait elapses even in the worst case of slew between the tick and
busy-wait clocks.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
Peter Bigot
2020-05-29 10:50:51 -05:00
committed by Carles Cufí
parent ac94ffedce
commit 365fd524cd

View File

@@ -195,7 +195,11 @@ void test_timer_period_0(void)
{
init_timer_data();
/** TESTPOINT: set period 0 */
k_timer_start(&period0_timer, K_MSEC(DURATION), K_NO_WAIT);
k_timer_start(&period0_timer,
K_TICKS(k_ms_to_ticks_floor32(DURATION)
- BUSY_SLEW_THRESHOLD_TICKS(DURATION
* USEC_PER_MSEC)),
K_NO_WAIT);
tdata.timestamp = k_uptime_get();
busy_wait_ms(DURATION + 1);