mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
fix(wifi): allow to disable wifi modem clocks if wifi is not inited
This commit is contained in:
@@ -34,6 +34,10 @@
|
||||
#include "esp_private/sleep_retention.h"
|
||||
#endif
|
||||
|
||||
#if SOC_MODEM_CLOCK_IS_INDEPENDENT
|
||||
#include "esp_private/esp_modem_clock.h"
|
||||
#endif
|
||||
|
||||
static bool s_wifi_inited = false;
|
||||
|
||||
#if (CONFIG_ESP_WIFI_RX_BA_WIN > CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM)
|
||||
@@ -221,6 +225,10 @@ static esp_err_t wifi_deinit_internal(void)
|
||||
|
||||
s_wifi_inited = false;
|
||||
|
||||
#if SOC_MODEM_CLOCK_IS_INDEPENDENT
|
||||
modem_clock_configure_wifi_status(s_wifi_inited);
|
||||
#endif
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -440,6 +448,10 @@ esp_err_t esp_wifi_init(const wifi_init_config_t *config)
|
||||
|
||||
s_wifi_inited = true;
|
||||
|
||||
#if SOC_MODEM_CLOCK_IS_INDEPENDENT
|
||||
modem_clock_configure_wifi_status(s_wifi_inited);
|
||||
#endif
|
||||
|
||||
return result;
|
||||
|
||||
_deinit:
|
||||
|
||||
Reference in New Issue
Block a user