drivers: timer: stm32_lptim fix TICKLESS=n processing

based on PR#25412
Some kernel tests use `CONFIG_TICKLESS_KERNEL=n` with
`CONFIG_SYS_CLOCK_TICKS_PER_SEC=1` to detect when a test runs longer
than 1 second.  These tests break if a tick is announced every time a
timeout occurs.  Only announce if the measured duration since the last
tick is at least the duration of a tick.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
This commit is contained in:
Francois Ramu 2020-05-19 08:52:33 +02:00 committed by Carles Cufí
commit 7be27b5169

View file

@ -74,7 +74,7 @@ static void lptim_irq_handler(struct device *unused)
/ LPTIM_CLOCK; / LPTIM_CLOCK;
z_clock_announce(IS_ENABLED(CONFIG_TICKLESS_KERNEL) z_clock_announce(IS_ENABLED(CONFIG_TICKLESS_KERNEL)
? dticks : 1); ? dticks : (dticks > 0));
} }
} }