From e22c4a146dc6ffd4ed4a3e75aaac2d9393c90e1e Mon Sep 17 00:00:00 2001 From: wuzhenghui Date: Fri, 11 Apr 2025 17:24:46 +0800 Subject: [PATCH] change(esp_hw_support): allow sar power keep on during lightsleep Closes https://github.com/espressif/esp-idf/issues/12426 --- components/esp_hw_support/sleep_modes.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/esp_hw_support/sleep_modes.c b/components/esp_hw_support/sleep_modes.c index aa85c38218..6a9021774b 100644 --- a/components/esp_hw_support/sleep_modes.c +++ b/components/esp_hw_support/sleep_modes.c @@ -700,7 +700,7 @@ FORCE_INLINE_ATTR void misc_modules_sleep_prepare(uint32_t sleep_flags, bool dee #if !CONFIG_IDF_TARGET_ESP32C61 // TODO: IDF-7370 - if (!(deep_sleep && (s_sleep_sub_mode_ref_cnt[ESP_SLEEP_USE_ADC_TSEN_MONITOR_MODE] != 0))){ + if (s_sleep_sub_mode_ref_cnt[ESP_SLEEP_USE_ADC_TSEN_MONITOR_MODE] == 0) { sar_periph_ctrl_power_disable(); } #endif @@ -731,7 +731,9 @@ FORCE_INLINE_ATTR void misc_modules_wake_prepare(uint32_t sleep_flags) } #endif #if !CONFIG_IDF_TARGET_ESP32C61 // TODO: IDF-9304 - sar_periph_ctrl_power_enable(); + if (s_sleep_sub_mode_ref_cnt[ESP_SLEEP_USE_ADC_TSEN_MONITOR_MODE] == 0) { + sar_periph_ctrl_power_enable(); + } #endif #if CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP && SOC_PM_CPU_RETENTION_BY_RTCCNTL sleep_disable_cpu_retention();