timer: ambiq_stimer: fixing disabling tickless not working issue

In init function, start timer with period CYC_PER_TICK if tickless is
not enabled, This change is for fixing the issue that disabling
CONFIG_TICKLESS_KERNEL the OS tick is not work issue, this
causes the OS not starting scheduling correctly.

Signed-off-by: Bryan Zhu <bzhu@ambiq.com>
This commit is contained in:
Bryan Zhu 2023-12-07 22:43:28 +08:00 committed by Carles Cufí
parent d11c65db07
commit 67099d2bba

View file

@ -142,7 +142,10 @@ static int stimer_init(void)
irq_enable(TIMER_IRQ);
am_hal_stimer_int_enable(AM_HAL_STIMER_INT_COMPAREA);
/* Start timer with period CYC_PER_TICK if tickless is not enabled */
if (!IS_ENABLED(CONFIG_TICKLESS_KERNEL)) {
am_hal_stimer_compare_delta_set(0, CYC_PER_TICK);
}
return 0;
}