Merge branch 'bugfix/wifi_deinit_stop_crash_v4.0' into 'release/v4.0'
esp_wifi: fix the crash when wifi stop after deinit (v4.0) See merge request espressif/esp-idf!10029
This commit is contained in:
commit
5ec780d6b5
1 changed files with 6 additions and 0 deletions
|
@ -30,6 +30,7 @@
|
|||
|
||||
ESP_EVENT_DEFINE_BASE(WIFI_EVENT);
|
||||
|
||||
extern uint8_t esp_wifi_get_user_init_flag_internal(void);
|
||||
#ifdef CONFIG_PM_ENABLE
|
||||
static esp_pm_lock_handle_t s_wifi_modem_sleep_lock;
|
||||
#endif
|
||||
|
@ -107,6 +108,11 @@ esp_err_t esp_wifi_deinit(void)
|
|||
{
|
||||
esp_err_t err = ESP_OK;
|
||||
|
||||
if (esp_wifi_get_user_init_flag_internal()) {
|
||||
ESP_LOGE(TAG, "Wi-Fi not stop");
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
esp_supplicant_deinit();
|
||||
err = esp_wifi_deinit_internal();
|
||||
if (err != ESP_OK) {
|
||||
|
|
Loading…
Reference in a new issue