driver: timer: stm32_lptim: fix hang when no tickless

When the tickless kernel isn't used, we don't want to wait for ARROK.
This wait can be endless.

Signed-off-by: Julien D'Ascenzio <julien.dascenzio@paratronic.fr>
This commit is contained in:
Julien D'Ascenzio 2020-05-07 16:29:49 +02:00 committed by Carles Cufí
commit b976e76866

View file

@ -178,6 +178,7 @@ int z_clock_driver_init(struct device *device)
void z_clock_set_timeout(s32_t ticks, bool idle)
{
#ifdef CONFIG_TICKLESS_KERNEL
/* new LPTIM1 AutoReload value to set (aligned on Kernel ticks) */
u32_t next_arr = 0;
@ -188,7 +189,6 @@ void z_clock_set_timeout(s32_t ticks, bool idle)
}
LL_LPTIM_ClearFlag_ARROK(LPTIM1);
#ifdef CONFIG_TICKLESS_KERNEL
if (ticks == K_TICKS_FOREVER) {
/* disable LPTIM */
LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_LPTIM1);