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
parent eaa883d4f0
commit b774342402
4 changed files with 56 additions and 10 deletions

View File

@@ -125,6 +125,7 @@ esp_err_t esp_wifi_deinit(void)
esp_unregister_mac_bb_pd_callback(pm_mac_sleep);
esp_unregister_mac_bb_pu_callback(pm_mac_wakeup);
#endif
esp_wifi_power_domain_off();
return err;
}
@@ -169,6 +170,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",