Эх сурвалжийг харах

Merge branch 'bugfix/support_esp32c3_lightsleep_master_cpu_pd_issue' into 'master'

fix cpu pd bug of normal light sleep

See merge request espressif/esp-idf!12083
Jiang Jiang Jian 5 жил өмнө
parent
commit
9c5a9ae8fd

+ 2 - 2
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.
 

+ 6 - 2
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

+ 1 - 0
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.