Power Management: power up or down wifi power domain when wifi init or deinit

This commit is contained in:
Li Shuai
2021-09-14 17:15:58 +08:00
committed by baohongde
parent e9514be5f8
commit a66b5bbda2
4 changed files with 56 additions and 8 deletions

View File

@@ -137,10 +137,12 @@ esp_err_t esp_wifi_deinit(void)
esp_unregister_mac_bb_pu_callback(pm_mac_wakeup);
#endif
esp_wifi_power_domain_off();
#if CONFIG_MAC_BB_PD
esp_mac_bb_pd_mem_deinit();
#endif
esp_phy_pd_mem_deinit();
return err;
}
@@ -185,6 +187,7 @@ static void esp_wifi_config_info(void)
esp_err_t esp_wifi_init(const wifi_init_config_t *config)
{
esp_wifi_power_domain_on();
#ifdef CONFIG_PM_ENABLE
if (s_wifi_modem_sleep_lock == NULL) {
esp_err_t err = esp_pm_lock_create(ESP_PM_APB_FREQ_MAX, 0, "wifi",