esp32: Clear the timer interrupt to avoid losing the next one
This commit is contained in:
parent
5d3f47c37b
commit
1ab8c1ea01
@ -159,6 +159,8 @@ static int esp32_timer_handler(int irq, void *context, void *arg)
|
||||
(struct esp32_timer_lowerhalf_s *)arg;
|
||||
uint32_t next_interval_us = 0;
|
||||
|
||||
ESP32_TIM_ACKINT(priv->tim); /* Clear the Interrupt */
|
||||
|
||||
if (priv->callback(&next_interval_us, priv->upper))
|
||||
{
|
||||
if (next_interval_us > 0)
|
||||
@ -174,7 +176,6 @@ static int esp32_timer_handler(int irq, void *context, void *arg)
|
||||
}
|
||||
|
||||
ESP32_TIM_SETALRM(priv->tim, true); /* Re-enables the alarm */
|
||||
ESP32_TIM_ACKINT(priv->tim); /* Clear the Interrupt */
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user