Skip to content

Commit b41fb37

Browse files
committed
change(esp_hw_support): allow sar power keep on during lightsleep
Closes #12426
1 parent 771e9db commit b41fb37

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

components/esp_hw_support/sleep_modes.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ FORCE_INLINE_ATTR void misc_modules_sleep_prepare(uint32_t sleep_flags, bool dee
707707
#endif
708708
}
709709

710-
if (!(deep_sleep && (s_sleep_sub_mode_ref_cnt[ESP_SLEEP_USE_ADC_TSEN_MONITOR_MODE] != 0))){
710+
if (s_sleep_sub_mode_ref_cnt[ESP_SLEEP_USE_ADC_TSEN_MONITOR_MODE] == 0) {
711711
// TODO: IDF-7370
712712
sar_periph_ctrl_power_disable();
713713
}
@@ -737,7 +737,9 @@ FORCE_INLINE_ATTR void misc_modules_wake_prepare(uint32_t sleep_flags)
737737
sleep_usb_otg_phy_restore();
738738
}
739739
#endif
740-
sar_periph_ctrl_power_enable();
740+
if (s_sleep_sub_mode_ref_cnt[ESP_SLEEP_USE_ADC_TSEN_MONITOR_MODE] == 0) {
741+
sar_periph_ctrl_power_enable();
742+
}
741743
#if CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP && SOC_PM_CPU_RETENTION_BY_RTCCNTL
742744
sleep_disable_cpu_retention();
743745
#endif

0 commit comments

Comments
 (0)