mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-31 03:07:21 +02:00
deep sleep: close rf to optimize sleep current
This commit is contained in:
@ -640,7 +640,13 @@ static uint32_t IRAM_ATTR esp_sleep_start(uint32_t pd_flags)
|
|||||||
rtc_sleep_low_init(s_config.rtc_clk_cal_period);
|
rtc_sleep_low_init(s_config.rtc_clk_cal_period);
|
||||||
|
|
||||||
// Set state machine time for light sleep
|
// Set state machine time for light sleep
|
||||||
if (!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();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
rtc_sleep_low_init(s_config.rtc_clk_cal_period);
|
rtc_sleep_low_init(s_config.rtc_clk_cal_period);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -153,6 +153,12 @@ esp_err_t esp_phy_store_cal_data_to_nvs(const esp_phy_calibration_data_t* cal_da
|
|||||||
*/
|
*/
|
||||||
esp_err_t esp_phy_erase_cal_data_in_nvs(void);
|
esp_err_t esp_phy_erase_cal_data_in_nvs(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get phy initialize status
|
||||||
|
* @return return true if phy is already initialized.
|
||||||
|
*/
|
||||||
|
bool esp_phy_is_initialized(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Enable PHY and RF module
|
* @brief Enable PHY and RF module
|
||||||
*
|
*
|
||||||
|
@ -233,6 +233,11 @@ static inline void phy_digital_regs_load(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool esp_phy_is_initialized(void)
|
||||||
|
{
|
||||||
|
return s_is_phy_calibrated;
|
||||||
|
}
|
||||||
|
|
||||||
void esp_phy_enable(void)
|
void esp_phy_enable(void)
|
||||||
{
|
{
|
||||||
_lock_acquire(&s_phy_access_lock);
|
_lock_acquire(&s_phy_access_lock);
|
||||||
|
@ -31,7 +31,7 @@ Once wakeup sources are configured, application can enter sleep mode using :cpp:
|
|||||||
WiFi/BT and sleep modes
|
WiFi/BT and sleep modes
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
In deep sleep and light sleep modes, wireless peripherals are powered down. Before entering deep sleep or light sleep modes, applications must disable WiFi and BT using appropriate calls (:cpp:func:`esp_bluedroid_disable`, :cpp:func:`esp_bt_controller_disable`, :cpp:func:`esp_wifi_stop`). WiFi and BT connections will not be maintained in deep sleep or light sleep, even if these functions are not called.
|
In deep sleep and light sleep modes, wireless peripherals are powered down. Before entering light sleep modes, applications must disable WiFi and BT using appropriate calls (:cpp:func:`esp_bluedroid_disable`, :cpp:func:`esp_bt_controller_disable`, :cpp:func:`esp_wifi_stop`). WiFi and BT connections will not be maintained in deep sleep or light sleep, even if these functions are not called.
|
||||||
|
|
||||||
.. only:: not SOC_BT_SUPPORTED
|
.. only:: not SOC_BT_SUPPORTED
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user