From 91dbae3eb53b436e934ebceb9aaf908c34496288 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 --- 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 535de8859d..83e923ece1 100644 --- a/components/esp_pm/pm_impl.c +++ b/components/esp_pm/pm_impl.c @@ -579,10 +579,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; + } } } }