STM32 timers: avoid RMW when clearing interrupt flags
All defined bits are rc_w0. The paranoid version of this would write 0 to the reserved bits (0 is the "reset value"), but this would require knowing which flags are valid on the actual platform, and adding the corresponding macros.
This commit is contained in:
parent
1d36685759
commit
410f2dd5a1
|
@ -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;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
Loading…
Reference in New Issue