esp32c3: Clear the timer interrupt to avoid losing the next one
This commit is contained in:
parent
e3748be0e5
commit
1b58542dd4
1 changed files with 3 additions and 1 deletions
|
|
@ -134,6 +134,8 @@ static int esp32c3_timer_handler(int irq, void *context, void *arg)
|
|||
(struct esp32c3_timer_lowerhalf_s *)arg;
|
||||
uint32_t next_interval_us = 0;
|
||||
|
||||
ESP32C3_TIM_ACKINT(priv->tim); /* Clear the Interrupt */
|
||||
|
||||
if (priv->callback(&next_interval_us, priv->upper))
|
||||
{
|
||||
if (next_interval_us > 0)
|
||||
|
|
@ -149,7 +151,7 @@ static int esp32c3_timer_handler(int irq, void *context, void *arg)
|
|||
}
|
||||
|
||||
ESP32C3_TIM_SETALRM(priv->tim, true); /* Re-enables the alarm */
|
||||
ESP32C3_TIM_ACKINT(priv->tim); /* Clear the Interrupt */
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue