mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-29 18:27:20 +02:00
feat(esp_hw_support): count pau backup time into sleep rejection judgment
This commit is contained in:
@ -1529,9 +1529,10 @@ static esp_err_t timer_wakeup_prepare(int64_t sleep_duration)
|
||||
|
||||
#if SOC_LP_TIMER_SUPPORTED
|
||||
#if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP
|
||||
int64_t backup_cost_ticks = rtc_time_us_to_slowclk(((pmu_sleep_machine_constant_t *)PMU_instance()->mc)->hp.regdma_a2s_work_time_us, s_config.rtc_clk_cal_period);
|
||||
// Last timer wake-up validity check
|
||||
if ((sleep_duration == 0) || \
|
||||
(target_wakeup_tick < rtc_time_get() + SLEEP_TIMER_ALARM_TO_SLEEP_TICKS)) {
|
||||
(target_wakeup_tick < rtc_time_get() + SLEEP_TIMER_ALARM_TO_SLEEP_TICKS + backup_cost_ticks)) {
|
||||
// Treat too short sleep duration setting as timer reject
|
||||
return ESP_ERR_SLEEP_REJECT;
|
||||
}
|
||||
|
Reference in New Issue
Block a user