diff --git a/lib/stm32/common/timer_common_all.c b/lib/stm32/common/timer_common_all.c index c24bd6ba..3619a234 100644 --- a/lib/stm32/common/timer_common_all.c +++ b/lib/stm32/common/timer_common_all.c @@ -280,7 +280,8 @@ tim_reg_base void timer_clear_flag(uint32_t timer_peripheral, uint32_t flag) { - TIM_SR(timer_peripheral) &= ~flag; + /* All defined bits are rc_w0 */ + TIM_SR(timer_peripheral) = ~flag; } /*---------------------------------------------------------------------------*/