From 34f89091b2176498edaa99fb7d04c81a6d797266 Mon Sep 17 00:00:00 2001 From: wuzhenghui Date: Thu, 21 Sep 2023 15:11:55 +0800 Subject: [PATCH] fix(sleep): fix modem reject the deepsleep request --- components/esp_hw_support/sleep_modes.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/components/esp_hw_support/sleep_modes.c b/components/esp_hw_support/sleep_modes.c index 723a82d1fa..e989dd2f0d 100644 --- a/components/esp_hw_support/sleep_modes.c +++ b/components/esp_hw_support/sleep_modes.c @@ -666,10 +666,14 @@ static esp_err_t IRAM_ATTR esp_sleep_start(uint32_t pd_flags, esp_sleep_mode_t m } #endif - /* Enable sleep reject for faster return from this function, - * in case the wakeup is already triggerred. - */ - uint32_t reject_triggers = (s_config.wakeup_triggers & RTC_SLEEP_REJECT_MASK) | sleep_modem_reject_triggers(); + uint32_t reject_triggers = s_config.wakeup_triggers & RTC_SLEEP_REJECT_MASK; + + if (!deep_sleep) { + /* Enable sleep reject for faster return from this function, + * in case the wakeup is already triggerred. + */ + reject_triggers |= sleep_modem_reject_triggers(); + } //Append some flags in addition to power domains uint32_t sleep_flags = pd_flags;