From d6b5bf33b241c1762fd44fe8d7d6480452c5dc6d Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Tue, 1 Mar 2022 14:10:15 +0100 Subject: [PATCH] cpu/stm32: timer: implement TIM_FLAG_SET_STOPPED --- cpu/stm32/periph/timer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cpu/stm32/periph/timer.c b/cpu/stm32/periph/timer.c index 64d929b40e..a09c601c94 100644 --- a/cpu/stm32/periph/timer.c +++ b/cpu/stm32/periph/timer.c @@ -149,6 +149,10 @@ int timer_set_periodic(tim_t tim, int channel, unsigned int value, uint8_t flags clear_oneshot(tim, channel); + if (flags & TIM_FLAG_SET_STOPPED) { + timer_stop(tim); + } + if (flags & TIM_FLAG_RESET_ON_SET) { /* setting COUNT gives us an interrupt on all channels */ unsigned state = irq_disable();