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 <francois.ramu@st.com>
This commit is contained in:
parent
b976e76866
commit
b0081d1f38
1 changed files with 4 additions and 3 deletions
|
@ -178,12 +178,15 @@ int z_clock_driver_init(struct device *device)
|
||||||
|
|
||||||
void z_clock_set_timeout(s32_t ticks, bool idle)
|
void z_clock_set_timeout(s32_t ticks, bool idle)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_TICKLESS_KERNEL
|
|
||||||
/* new LPTIM1 AutoReload value to set (aligned on Kernel ticks) */
|
/* new LPTIM1 AutoReload value to set (aligned on Kernel ticks) */
|
||||||
u32_t next_arr = 0;
|
u32_t next_arr = 0;
|
||||||
|
|
||||||
ARG_UNUSED(idle);
|
ARG_UNUSED(idle);
|
||||||
|
|
||||||
|
if (!IS_ENABLED(CONFIG_TICKLESS_KERNEL)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* ARROK bit validates previous write operation to ARR register */
|
/* ARROK bit validates previous write operation to ARR register */
|
||||||
while (LL_LPTIM_IsActiveFlag_ARROK(LPTIM1) == 0) {
|
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);
|
LL_LPTIM_SetAutoReload(LPTIM1, next_arr);
|
||||||
|
|
||||||
k_spin_unlock(&lock, key);
|
k_spin_unlock(&lock, key);
|
||||||
|
|
||||||
#endif /* CONFIG_TICKLESS_KERNEL */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
u32_t z_clock_elapsed(void)
|
u32_t z_clock_elapsed(void)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue