mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-31 19:24:33 +02:00
Merge branch 'bugfix/fix_deepsleep_saradc_leakage_by_sar_v4.4' into 'release/v4.4'
bugfix: fix adc current leakage by sar_adc on v4.4 See merge request espressif/esp-idf!24349
This commit is contained in:
@@ -339,6 +339,17 @@ 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
|
||||||
@@ -351,7 +362,8 @@ inline static void IRAM_ATTR misc_modules_sleep_prepare(bool deep_sleep)
|
|||||||
#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) {
|
|
||||||
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);
|
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