We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c6126bc commit c94a993Copy full SHA for c94a993
arch/arm/src/stm32l4/stm32l4_qencoder.c
@@ -1086,10 +1086,10 @@ static int stm32l4_reset(struct qe_lowerhalf_s *lower)
1086
* Interrupts are disabled to make this atomic (if possible)
1087
*/
1088
1089
- flags = enter_critical_section();
+ flags = spin_lock_irqsave(&priv->lock);
1090
stm32l4_putreg32(priv, STM32L4_GTIM_CNT_OFFSET, 0);
1091
priv->position = 0;
1092
- leave_critical_section(flags);
+ spin_unlock_irqrestore(&priv->lock, flags);
1093
#else
1094
sninfo("Resetting position to zero\n");
1095
DEBUGASSERT(lower && priv->inuse);
0 commit comments