mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 01:29:21 -04:00
deep sleep: close rf to optimize sleep current
This commit is contained in:
parent
568dd3d823
commit
64d5421d8b
@ -447,7 +447,13 @@ static uint32_t IRAM_ATTR esp_sleep_start(uint32_t pd_flags)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
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 {
|
||||||
misc_modules_sleep_prepare();
|
misc_modules_sleep_prepare();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,6 +150,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
|
||||||
*
|
*
|
||||||
|
@ -224,6 +224,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, the application can enter sleep mode using :
|
|||||||
Wi-Fi/Bluetooth and Sleep Modes
|
Wi-Fi/Bluetooth and Sleep Modes
|
||||||
---------------------------------
|
---------------------------------
|
||||||
|
|
||||||
In Deep-sleep and Light-sleep modes, the wireless peripherals are powered down. Before entering Deep-sleep or Light-sleep modes, the application must disable Wi-Fi and Bluetooth using the appropriate calls (i.e., :cpp:func:`esp_bluedroid_disable`, :cpp:func:`esp_bt_controller_disable`, :cpp:func:`esp_wifi_stop`). Wi-Fi and Bluetooth connections will not be maintained in Deep-sleep or Light-sleep mode, even if these functions are not called.
|
In Deep-sleep and Light-sleep modes, the wireless peripherals are powered down. Before entering Light-sleep modes, the application must disable Wi-Fi and Bluetooth using the appropriate calls (i.e., :cpp:func:`esp_bluedroid_disable`, :cpp:func:`esp_bt_controller_disable`, :cpp:func:`esp_wifi_stop`). In both Deep-sleep and Light-sleep modes, Wi-Fi and Bluetooth connection cannot be maintained.
|
||||||
|
|
||||||
.. only:: not SOC_BT_SUPPORTED
|
.. only:: not SOC_BT_SUPPORTED
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ Light-sleep 和 Deep-sleep 模式有多种唤醒源。这些唤醒源也可以
|
|||||||
睡眠模式下的 Wi-Fi 功能
|
睡眠模式下的 Wi-Fi 功能
|
||||||
--------------------------
|
--------------------------
|
||||||
|
|
||||||
在 Light-sleep 和 Deep-sleep 模式下,无线外设会被断电。因此,在进入这两种睡眠模式前,应用程序必须调用恰当的函数 (:cpp:func:`esp_wifi_stop`) 来禁用 Wi-Fi。在 Light-sleep 或 Deep-sleep 模式下,即使不调用此函数也无法连接 Wi-Fi。
|
在 Light-sleep 和 Deep-sleep 模式下,无线外设会被断电。因此,在进入 Light-sleep 模式前,应用程序必须调用恰当的函数 (:cpp:func:`esp_wifi_stop`) 来禁用 Wi-Fi。在 Light-sleep 和 Deep-sleep 模式下均无法保持 Wi-Fi 的连接。
|
||||||
|
|
||||||
如需保持 Wi-Fi 连接,请启用 Wi-Fi Modem-sleep 模式和自动 Light-sleep 模式(请参阅 :doc:`电源管理 API <power_management>`)。在这两种模式下,Wi-Fi 驱动程序发出请求时,系统将自动从睡眠中被唤醒,从而保持与 AP 的连接。
|
如需保持 Wi-Fi 连接,请启用 Wi-Fi Modem-sleep 模式和自动 Light-sleep 模式(请参阅 :doc:`电源管理 API <power_management>`)。在这两种模式下,Wi-Fi 驱动程序发出请求时,系统将自动从睡眠中被唤醒,从而保持与 AP 的连接。
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user