From b0081d1f3893516b51a2d89fa9fe337ff96a282e Mon Sep 17 00:00:00 2001 From: Francois Ramu Date: Mon, 11 May 2020 13:12:52 +0200 Subject: [PATCH] driver: timer: stm32_lptim: tickless mode without a compilation flag In the timeout function, remove the compilation flag and use the macro instead. Signed-off-by: Francois Ramu --- drivers/timer/stm32_lptim_timer.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/timer/stm32_lptim_timer.c b/drivers/timer/stm32_lptim_timer.c index 09fae750f1d..5ca5ebf324f 100644 --- a/drivers/timer/stm32_lptim_timer.c +++ b/drivers/timer/stm32_lptim_timer.c @@ -178,12 +178,15 @@ 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; ARG_UNUSED(idle); + if (!IS_ENABLED(CONFIG_TICKLESS_KERNEL)) { + return; + } + /* ARROK bit validates previous write operation to ARR register */ while (LL_LPTIM_IsActiveFlag_ARROK(LPTIM1) == 0) { } @@ -247,8 +250,6 @@ void z_clock_set_timeout(s32_t ticks, bool idle) LL_LPTIM_SetAutoReload(LPTIM1, next_arr); k_spin_unlock(&lock, key); - -#endif /* CONFIG_TICKLESS_KERNEL */ } u32_t z_clock_elapsed(void)