esp_timer: Fix the stop alarm triggering when the timer list is empty

Related to ESP32-C6 chip only because this chip can power down the digital domain
during the light sleep. And after wakes up, systimer gets resumed,
and the alarm value < count value, so it leads the alarm fired immediately.
We get one unnecessary interrupt at light sleep exit time.

Other chips do not power down the digital domain related to systimer.
pull/10391/head
KonstantinKondrashov 2022-11-16 23:44:31 +08:00 zatwierdzone przez BOT
rodzic cee025c003
commit 54b06ecb62
1 zmienionych plików z 1 dodań i 3 usunięć

Wyświetl plik

@ -80,9 +80,7 @@ void IRAM_ATTR esp_timer_impl_set_alarm_id(uint64_t timestamp, unsigned alarm_id
portENTER_CRITICAL_SAFE(&s_time_update_lock);
timestamp_id[alarm_id] = timestamp;
timestamp = MIN(timestamp_id[0], timestamp_id[1]);
if (timestamp != UINT64_MAX) {
systimer_hal_set_alarm_target(&systimer_hal, SYSTIMER_LL_ALARM_CLOCK, timestamp);
}
systimer_hal_set_alarm_target(&systimer_hal, SYSTIMER_LL_ALARM_CLOCK, timestamp);
portEXIT_CRITICAL_SAFE(&s_time_update_lock);
}