diff --git a/kernel/timer.c b/kernel/timer.c index 55760c05325..900e88e2a8c 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -126,7 +126,9 @@ void z_impl_k_timer_start(struct k_timer *timer, k_timeout_t duration, * argument the same way k_sleep() does), but historical. The * timer_api test relies on this behavior. */ - period.ticks = MAX(period.ticks - 1, 0); + if (period.ticks != 0 && Z_TICK_ABS(period.ticks) < 0) { + period.ticks = MAX(period.ticks - 1, 1); + } if (Z_TICK_ABS(duration.ticks) < 0) { duration.ticks = MAX(duration.ticks - 1, 0); }