AnsweredAssumed Answered

STM32SnippetsL0 TIMER examples bug

Question asked by Jive Tihs on Aug 16, 2017
Latest reply on Aug 17, 2017 by Jive Tihs

In TIMERS/03_InputCapureOnTI1/main.c and TIMERS/04_PWM_Input/main.c the flags after an interrupt are being cleared this way:

 

TIMx->SR = ~(TIM_SR_CC1OF | TIM_SR_CC1IF); /* Clear the flags */

 

Shouldn't it be like below?

 

TIMx->SR &= ~(TIM_SR_CC1OF | TIM_SR_CC1IF); /* Clear the flags */

Outcomes