فهرست منبع

fix the wifi scan fail issue caused by the power off the wifi power domain

Li Shuai 4 سال پیش
والد
کامیت
bf650edc55
3فایلهای تغییر یافته به همراه12 افزوده شده و 1 حذف شده
  1. 7 0
      components/esp_phy/include/phy.h
  2. 1 1
      components/esp_phy/lib
  3. 4 0
      components/esp_wifi/src/wifi_init.c

+ 7 - 0
components/esp_phy/include/phy.h

@@ -68,6 +68,13 @@ void phy_close_rf(void);
 void phy_xpd_tsens(void);
 #endif
 
+#if CONFIG_IDF_TARGET_ESP32C3
+/**
+ * @brief Update internal state of PHY when wifi deinit powers off the wifi power domain.
+ */
+void phy_init_flag(void);
+#endif
+
 /**
  * @brief Store and load PHY digital registers.
  *

+ 1 - 1
components/esp_phy/lib

@@ -1 +1 @@
-Subproject commit 7586abbf591ab63d609d7afeb377559deabec808
+Subproject commit fe7dc9599bd318518eccc165d9e751114e28e7d2

+ 4 - 0
components/esp_wifi/src/wifi_init.c

@@ -19,6 +19,7 @@
 #include "driver/adc2_wifi_private.h"
 #include "esp_coexist_internal.h"
 #include "esp_phy_init.h"
+#include "phy.h"
 
 #if (CONFIG_ESP32_WIFI_RX_BA_WIN > CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM)
 #error "WiFi configuration check: WARNING, WIFI_RX_BA_WIN should not be larger than WIFI_DYNAMIC_RX_BUFFER_NUM!"
@@ -124,6 +125,9 @@ esp_err_t esp_wifi_deinit(void)
 #if CONFIG_MAC_BB_PD
     esp_unregister_mac_bb_pd_callback(pm_mac_sleep);
     esp_unregister_mac_bb_pu_callback(pm_mac_wakeup);
+#endif
+#if CONFIG_IDF_TARGET_ESP32C3
+    phy_init_flag();
 #endif
     esp_wifi_power_domain_off();
     return err;