Permalink
Browse files

Write 0 to clear flags in the timer SR, no need to read from it.

  • Loading branch information...
1 parent a5f4a98 commit 611d048057648cacb5fa2bd4b91514213ab0bc61 @fnoble committed Apr 24, 2012
Showing with 3 additions and 3 deletions.
  1. +1 −1 lib/stm32/f1/timer.c
  2. +1 −1 lib/stm32/f2/timer.c
  3. +1 −1 lib/stm32/f4/timer.c
@@ -115,7 +115,7 @@ bool timer_get_flag(u32 timer_peripheral, u32 flag)
void timer_clear_flag(u32 timer_peripheral, u32 flag)
{
- TIM_SR(timer_peripheral) &= ~flag;
+ TIM_SR(timer_peripheral) = ~flag;
}
void timer_set_mode(u32 timer_peripheral, u8 clock_div,
@@ -116,7 +116,7 @@ bool timer_get_flag(u32 timer_peripheral, u32 flag)
void timer_clear_flag(u32 timer_peripheral, u32 flag)
{
- TIM_SR(timer_peripheral) &= ~flag;
+ TIM_SR(timer_peripheral) = ~flag;
}
void timer_set_mode(u32 timer_peripheral, u8 clock_div,
@@ -116,7 +116,7 @@ bool timer_get_flag(u32 timer_peripheral, u32 flag)
void timer_clear_flag(u32 timer_peripheral, u32 flag)
{
- TIM_SR(timer_peripheral) &= ~flag;
+ TIM_SR(timer_peripheral) = ~flag;
}
void timer_set_mode(u32 timer_peripheral, u8 clock_div,

0 comments on commit 611d048

Please sign in to comment.