mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
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.
This commit is contained in:
parent
cee025c003
commit
54b06ecb62
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user