mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-31 19:24:33 +02:00
bugfix: fix adc current leakage by sar_adc on v4.4
This commit is contained in:
@@ -339,19 +339,31 @@ static void IRAM_ATTR resume_uarts(uint32_t uarts_resume_bmap)
|
|||||||
*/
|
*/
|
||||||
inline static void IRAM_ATTR misc_modules_sleep_prepare(bool deep_sleep)
|
inline static void IRAM_ATTR misc_modules_sleep_prepare(bool deep_sleep)
|
||||||
{
|
{
|
||||||
|
if (deep_sleep) {
|
||||||
|
extern bool esp_phy_is_initialized(void);
|
||||||
|
if (esp_phy_is_initialized()){
|
||||||
|
extern void phy_close_rf(void);
|
||||||
|
phy_close_rf();
|
||||||
|
#if !CONFIG_IDF_TARGET_ESP32
|
||||||
|
extern void phy_xpd_tsens(void);
|
||||||
|
phy_xpd_tsens();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
} else {
|
||||||
#if CONFIG_MAC_BB_PD
|
#if CONFIG_MAC_BB_PD
|
||||||
mac_bb_power_down_cb_execute();
|
mac_bb_power_down_cb_execute();
|
||||||
#endif
|
#endif
|
||||||
#if CONFIG_GPIO_ESP32_SUPPORT_SWITCH_SLP_PULL
|
#if CONFIG_GPIO_ESP32_SUPPORT_SWITCH_SLP_PULL
|
||||||
gpio_sleep_mode_config_apply();
|
gpio_sleep_mode_config_apply();
|
||||||
#endif
|
#endif
|
||||||
#if SOC_PM_SUPPORT_CPU_PD || SOC_PM_SUPPORT_TAGMEM_PD
|
#if SOC_PM_SUPPORT_CPU_PD || SOC_PM_SUPPORT_TAGMEM_PD
|
||||||
sleep_enable_memory_retention();
|
sleep_enable_memory_retention();
|
||||||
#endif
|
#endif
|
||||||
#if REGI2C_ANA_CALI_PD_WORKAROUND
|
#if REGI2C_ANA_CALI_PD_WORKAROUND
|
||||||
regi2c_analog_cali_reg_read();
|
regi2c_analog_cali_reg_read();
|
||||||
#endif
|
#endif
|
||||||
if (!(deep_sleep && s_adc_tsen_enabled)){
|
}
|
||||||
|
if (!(deep_sleep && s_adc_tsen_enabled)) {
|
||||||
sar_periph_ctrl_power_disable();
|
sar_periph_ctrl_power_disable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -443,19 +455,7 @@ static uint32_t IRAM_ATTR esp_sleep_start(uint32_t pd_flags)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (deep_sleep) {
|
misc_modules_sleep_prepare(deep_sleep);
|
||||||
extern bool esp_phy_is_initialized(void);
|
|
||||||
if (esp_phy_is_initialized()){
|
|
||||||
extern void phy_close_rf(void);
|
|
||||||
phy_close_rf();
|
|
||||||
#if !CONFIG_IDF_TARGET_ESP32
|
|
||||||
extern void phy_xpd_tsens(void);
|
|
||||||
phy_xpd_tsens();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
misc_modules_sleep_prepare(deep_sleep);
|
|
||||||
}
|
|
||||||
|
|
||||||
#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3
|
#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3
|
||||||
if (deep_sleep) {
|
if (deep_sleep) {
|
||||||
|
Reference in New Issue
Block a user