From 0ddf00c6e1415d6b72b8e65ff9366489f7c47a3a Mon Sep 17 00:00:00 2001 From: ninh Date: Fri, 23 Apr 2021 17:44:50 +0800 Subject: [PATCH] esp_pm: allow dfs to swith down alltime if no lightsleep (backport to v4.3) --- components/esp_pm/pm_impl.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/components/esp_pm/pm_impl.c b/components/esp_pm/pm_impl.c index a0f360108f..53da0f289c 100644 --- a/components/esp_pm/pm_impl.c +++ b/components/esp_pm/pm_impl.c @@ -580,10 +580,12 @@ esp_err_t esp_pm_unregister_skip_light_sleep_callback(skip_light_sleep_cb_t cb) static inline bool IRAM_ATTR periph_should_skip_light_sleep(void) { - for (int i = 0; i < PERIPH_SKIP_LIGHT_SLEEP_NO; i++) { - if (s_periph_skip_light_sleep_cb[i]) { - if (s_periph_skip_light_sleep_cb[i]() == true) { - return true; + if (s_light_sleep_en) { + for (int i = 0; i < PERIPH_SKIP_LIGHT_SLEEP_NO; i++) { + if (s_periph_skip_light_sleep_cb[i]) { + if (s_periph_skip_light_sleep_cb[i]() == true) { + return true; + } } } }