From eaa6ab4daba4c122fd420c8c0bf488c591063170 Mon Sep 17 00:00:00 2001 From: Li Shuai Date: Wed, 20 Jan 2021 22:17:24 +0800 Subject: [PATCH 1/3] light sleep: add system light sleep example support --- examples/system/light_sleep/main/light_sleep_example_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/system/light_sleep/main/light_sleep_example_main.c b/examples/system/light_sleep/main/light_sleep_example_main.c index d10c510aaf..28f39de5a5 100644 --- a/examples/system/light_sleep/main/light_sleep_example_main.c +++ b/examples/system/light_sleep/main/light_sleep_example_main.c @@ -18,6 +18,7 @@ #include "esp_log.h" #include "driver/uart.h" #include "driver/gpio.h" +#include "esp_timer.h" /* Most development boards have "boot" button attached to GPIO0. * You can also change this to another pin. From f57ab2d69b37a5594e95038d1b04b408a69baa5b Mon Sep 17 00:00:00 2001 From: Li Shuai Date: Wed, 20 Jan 2021 22:19:23 +0800 Subject: [PATCH 2/3] add brownout reset option prompt to menuconfig --- components/esp32c3/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/esp32c3/Kconfig b/components/esp32c3/Kconfig index cd54d9c192..49e2b75656 100644 --- a/components/esp32c3/Kconfig +++ b/components/esp32c3/Kconfig @@ -78,10 +78,10 @@ menu "ESP32C3-Specific" e.g. GCOV data dump. config ESP32C3_BROWNOUT_DET - bool + bool "Hardware brownout detect & reset" default y help - The ESP32-S3 has a built-in brownout detector which can detect if the voltage is lower than + The ESP32-C3 has a built-in brownout detector which can detect if the voltage is lower than a specific value. If this happens, it will reset the chip in order to prevent unintended behaviour. From 58ab3975eac87ba91e801c7d8c8e9d176fa3a3b5 Mon Sep 17 00:00:00 2001 From: Li Shuai Date: Wed, 20 Jan 2021 22:21:51 +0800 Subject: [PATCH 3/3] light sleep: fix cpu pd bug of normal light sleep --- components/esp_system/sleep_modes.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/components/esp_system/sleep_modes.c b/components/esp_system/sleep_modes.c index 1c846df1f3..7adcb468a9 100644 --- a/components/esp_system/sleep_modes.c +++ b/components/esp_system/sleep_modes.c @@ -1086,8 +1086,12 @@ static uint32_t get_power_down_flags(void) #endif // SOC_TOUCH_PAD_WAKE_SUPPORTED } -#if !SOC_PM_SUPPORT_CPU_PD - if (s_config.pd_options[ESP_PD_DOMAIN_CPU] == ESP_PD_OPTION_AUTO) { +#if SOC_PM_SUPPORT_CPU_PD + if (s_config.cpu_pd_mem == NULL) { + s_config.pd_options[ESP_PD_DOMAIN_CPU] = ESP_PD_OPTION_ON; + } +#else + if (s_config.pd_options[ESP_PD_DOMAIN_CPU] != ESP_PD_OPTION_ON) { s_config.pd_options[ESP_PD_DOMAIN_CPU] = ESP_PD_OPTION_ON; } #endif