bugfix: fix deepsleep saradc leakage

This commit is contained in:
wuzhenghui
2023-03-30 11:35:05 +08:00
committed by Armando
parent 6356453f8d
commit 941b6bf03d

View File

@ -332,7 +332,7 @@ static void IRAM_ATTR resume_uarts(void)
/**
* These save-restore workaround should be moved to lower layer
*/
inline static void IRAM_ATTR misc_modules_sleep_prepare(void)
inline static void IRAM_ATTR misc_modules_sleep_prepare(bool deep_sleep)
{
#if CONFIG_MAC_BB_PD
mac_bb_power_down_cb_execute();
@ -346,8 +346,10 @@ inline static void IRAM_ATTR misc_modules_sleep_prepare(void)
#if REGI2C_ANA_CALI_PD_WORKAROUND
regi2c_analog_cali_reg_read();
#endif
if (!(deep_sleep && s_adc_tsen_enabled)){
sar_periph_ctrl_power_disable();
}
}
/**
* These save-restore workaround should be moved to lower layer
@ -437,7 +439,7 @@ static uint32_t IRAM_ATTR esp_sleep_start(uint32_t pd_flags)
phy_close_rf();
}
} else {
misc_modules_sleep_prepare();
misc_modules_sleep_prepare(deep_sleep);
}
#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3