From ec3a1318dce8bb3dd026e8355691eeb0d0e2d590 Mon Sep 17 00:00:00 2001 From: zhangyanjiao Date: Fri, 31 Aug 2018 20:05:10 +0800 Subject: [PATCH] update wifi lib to fix two bugs 1. fix the esp_wifi_disconnect() err when wifi is not started or inited 2. make g_intr_lock_mux and g_osi_funs_p in DRAM --- components/esp32/include/esp_wifi.h | 4 +++- components/esp32/lib | 2 +- components/esp32/test/test_esp32.c | 8 ++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/components/esp32/include/esp_wifi.h b/components/esp32/include/esp_wifi.h index 04b999803e..66ccdcdd08 100644 --- a/components/esp32/include/esp_wifi.h +++ b/components/esp32/include/esp_wifi.h @@ -223,7 +223,9 @@ esp_err_t esp_wifi_init(const wifi_init_config_t *config); * * @attention 1. This API should be called if you want to remove WiFi driver from the system * - * @return ESP_OK: succeed + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init */ esp_err_t esp_wifi_deinit(void); diff --git a/components/esp32/lib b/components/esp32/lib index 1373c2075a..ea4bb37b0f 160000 --- a/components/esp32/lib +++ b/components/esp32/lib @@ -1 +1 @@ -Subproject commit 1373c2075a9524437cbb4bdfd8576dedb77c68a2 +Subproject commit ea4bb37b0f3df868608295cf6a5c08a0585a3881 diff --git a/components/esp32/test/test_esp32.c b/components/esp32/test/test_esp32.c index cdca805df4..08700fa56f 100644 --- a/components/esp32/test/test_esp32.c +++ b/components/esp32/test/test_esp32.c @@ -5,6 +5,7 @@ #include "unity.h" #include "esp_system.h" #include "esp_event_loop.h" +#include "esp_wifi_types.h" #include "esp_wifi.h" #include "esp_log.h" #include "nvs_flash.h" @@ -42,6 +43,11 @@ static esp_err_t event_handler(void *ctx, system_event_t *event) static void test_wifi_init_deinit(wifi_init_config_t *cfg, wifi_config_t* wifi_config) { + ESP_LOGI(TAG, EMPH_STR("esp_wifi_deinit")); + TEST_ESP_ERR(ESP_ERR_WIFI_NOT_INIT, esp_wifi_deinit()); + ESP_LOGI(TAG, EMPH_STR("esp_wifi_get_mode")); + wifi_mode_t mode_get; + TEST_ESP_ERR(ESP_ERR_WIFI_NOT_INIT, esp_wifi_get_mode(&mode_get)); ESP_LOGI(TAG, EMPH_STR("esp_wifi_init")); TEST_ESP_OK(esp_wifi_init(cfg)); ESP_LOGI(TAG, EMPH_STR("esp_wifi_set_mode")); @@ -54,6 +60,8 @@ static void test_wifi_init_deinit(wifi_init_config_t *cfg, wifi_config_t* wifi_c static void test_wifi_start_stop(wifi_init_config_t *cfg, wifi_config_t* wifi_config) { + ESP_LOGI(TAG, EMPH_STR("esp_wifi_stop")); + TEST_ESP_ERR(ESP_ERR_WIFI_NOT_INIT, esp_wifi_stop()); ESP_LOGI(TAG, EMPH_STR("esp_wifi_init")); TEST_ESP_OK(esp_wifi_init(cfg)); ESP_LOGI(TAG, EMPH_STR("esp_wifi_set_mode"));