2020-03-03 8:16 PM
Hi, does
htim4.Instance->CNT = 0
resets the counter value in TIM4_CNT ?
Does it guarantee atomicity ?
Thanks in advance!
2020-03-03 9:02 PM
yes sure
2020-03-03 9:09 PM
but will start again timer automatically
if you have to reset timer then use
TIMx->CR1 = !(TIM_CR1_CEN); will stop timer permanently
2020-03-03 9:09 PM
Best of luck
2020-03-03 9:43 PM
Thanks!
2020-03-07 1:13 AM
That code is wrong. Effectively it will translate to:
TIMx->CR1 = 0;
What was meant, is:
TIMx->CR1 &= ~TIM_CR1_CEN;