mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-02 20:24:32 +02:00
Merge branch 'feature/wifi_merge_libs_to_master' into 'master'
esp_wifi: merge esp32s2beta WiFi library and fix WiFi deinit memory leak bug See merge request espressif/esp-idf!6531
This commit is contained in:
11
.gitmodules
vendored
11
.gitmodules
vendored
@@ -67,14 +67,6 @@
|
|||||||
path = examples/build_system/cmake/import_lib/main/lib/tinyxml2
|
path = examples/build_system/cmake/import_lib/main/lib/tinyxml2
|
||||||
url = ../../leethomason/tinyxml2.git
|
url = ../../leethomason/tinyxml2.git
|
||||||
|
|
||||||
[submodule "components/esp_wifi/lib_esp32"]
|
|
||||||
path = components/esp_wifi/lib_esp32
|
|
||||||
url = ../../espressif/esp32-wifi-lib.git
|
|
||||||
|
|
||||||
[submodule "components/esp_wifi/lib_esp32s2beta"]
|
|
||||||
path = components/esp_wifi/lib_esp32s2beta
|
|
||||||
url = ../../espressif/esp32-wifi-lib.git
|
|
||||||
|
|
||||||
[submodule "components/bt/host/nimble/nimble"]
|
[submodule "components/bt/host/nimble/nimble"]
|
||||||
path = components/bt/host/nimble/nimble
|
path = components/bt/host/nimble/nimble
|
||||||
url = ../../espressif/esp-nimble.git
|
url = ../../espressif/esp-nimble.git
|
||||||
@@ -83,3 +75,6 @@
|
|||||||
path = components/cbor/tinycbor
|
path = components/cbor/tinycbor
|
||||||
url = ../../intel/tinycbor.git
|
url = ../../intel/tinycbor.git
|
||||||
|
|
||||||
|
[submodule "components/esp_wifi/lib"]
|
||||||
|
path = components/esp_wifi/lib
|
||||||
|
url = ../../espressif/esp32-wifi-lib.git
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
# Submodules normally added in component.mk, but fully qualified
|
# Submodules normally added in component.mk, but fully qualified
|
||||||
# paths can be added at this level (we need binary librtc to be
|
# paths can be added at this level (we need binary librtc to be
|
||||||
# available to link bootloader).
|
# available to link bootloader).
|
||||||
COMPONENT_SUBMODULES += $(IDF_PATH)/components/esp_wifi/lib_esp32
|
COMPONENT_SUBMODULES += $(IDF_PATH)/components/esp_wifi/lib
|
||||||
|
@@ -20,7 +20,7 @@ idf_component_register(SRCS "src/coexist.c"
|
|||||||
LDFRAGMENTS "${ldfragments}")
|
LDFRAGMENTS "${ldfragments}")
|
||||||
|
|
||||||
idf_build_get_property(build_dir BUILD_DIR)
|
idf_build_get_property(build_dir BUILD_DIR)
|
||||||
target_link_libraries(${COMPONENT_LIB} PUBLIC "-L ${CMAKE_CURRENT_SOURCE_DIR}/lib_${idf_target}")
|
target_link_libraries(${COMPONENT_LIB} PUBLIC "-L ${CMAKE_CURRENT_SOURCE_DIR}/lib/${idf_target}")
|
||||||
|
|
||||||
if(link_binary_libs)
|
if(link_binary_libs)
|
||||||
if(CONFIG_IDF_TARGET_ESP32)
|
if(CONFIG_IDF_TARGET_ESP32)
|
||||||
@@ -39,7 +39,7 @@ if(link_binary_libs)
|
|||||||
|
|
||||||
foreach(blob ${blobs})
|
foreach(blob ${blobs})
|
||||||
add_library(${blob} STATIC IMPORTED)
|
add_library(${blob} STATIC IMPORTED)
|
||||||
set_property(TARGET ${blob} PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/lib_${idf_target}/lib${blob}.a)
|
set_property(TARGET ${blob} PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/lib/${idf_target}/lib${blob}.a)
|
||||||
target_link_libraries(${COMPONENT_LIB} PUBLIC ${blob})
|
target_link_libraries(${COMPONENT_LIB} PUBLIC ${blob})
|
||||||
|
|
||||||
foreach(_blob ${blobs})
|
foreach(_blob ${blobs})
|
||||||
|
@@ -7,14 +7,14 @@ COMPONENT_SRCDIRS := src
|
|||||||
|
|
||||||
ifndef CONFIG_ESP32_NO_BLOBS
|
ifndef CONFIG_ESP32_NO_BLOBS
|
||||||
LIBS := core rtc net80211 pp smartconfig coexist espnow phy mesh
|
LIBS := core rtc net80211 pp smartconfig coexist espnow phy mesh
|
||||||
COMPONENT_ADD_LDFLAGS += -L$(COMPONENT_PATH)/lib_$(IDF_TARGET) \
|
COMPONENT_ADD_LDFLAGS += -L$(COMPONENT_PATH)/lib/$(IDF_TARGET) \
|
||||||
$(addprefix -l,$(LIBS))
|
$(addprefix -l,$(LIBS))
|
||||||
|
|
||||||
COMPONENT_ADD_LDFRAGMENTS += linker.lf
|
COMPONENT_ADD_LDFRAGMENTS += linker.lf
|
||||||
|
|
||||||
COMPONENT_SUBMODULES += lib_$(IDF_TARGET)
|
COMPONENT_SUBMODULES += lib
|
||||||
|
|
||||||
ALL_LIB_FILES := $(patsubst %,$(COMPONENT_PATH)/lib_$(IDF_TARGET)/lib%.a,$(LIBS))
|
ALL_LIB_FILES := $(patsubst %,$(COMPONENT_PATH)/lib/$(IDF_TARGET)/lib%.a,$(LIBS))
|
||||||
COMPONENT_ADD_LINKER_DEPS += $(ALL_LIB_FILES)
|
COMPONENT_ADD_LINKER_DEPS += $(ALL_LIB_FILES)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@@ -102,6 +102,23 @@ typedef enum {
|
|||||||
*/
|
*/
|
||||||
esp_err_t esp_wifi_init_internal(const wifi_init_config_t *config);
|
esp_err_t esp_wifi_init_internal(const wifi_init_config_t *config);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Deinitialize Wi-Fi Driver
|
||||||
|
* Free resource for WiFi driver, such as WiFi control structure, RX/TX buffer,
|
||||||
|
* WiFi NVS structure among others.
|
||||||
|
*
|
||||||
|
* For the most part, you need not call this function directly. It gets called
|
||||||
|
* from esp_wifi_deinit().
|
||||||
|
*
|
||||||
|
* This function may be called, if you call esp_wifi_init_internal to initialize
|
||||||
|
* WiFi driver.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* - ESP_OK: succeed
|
||||||
|
* - others: refer to error code esp_err.h
|
||||||
|
*/
|
||||||
|
esp_err_t esp_wifi_deinit_internal(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief get whether the wifi driver is allowed to transmit data or not
|
* @brief get whether the wifi driver is allowed to transmit data or not
|
||||||
*
|
*
|
||||||
|
1
components/esp_wifi/lib
Submodule
1
components/esp_wifi/lib
Submodule
Submodule components/esp_wifi/lib added at d38f75b160
Submodule components/esp_wifi/lib_esp32 deleted from 1d830bc243
Submodule components/esp_wifi/lib_esp32s2beta deleted from 8ea1c65125
@@ -98,6 +98,21 @@ static void esp_wifi_set_debug_log(void)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
esp_err_t esp_wifi_deinit(void)
|
||||||
|
{
|
||||||
|
esp_err_t err = ESP_OK;
|
||||||
|
|
||||||
|
esp_supplicant_deinit();
|
||||||
|
err = esp_wifi_deinit_internal();
|
||||||
|
if (err != ESP_OK) {
|
||||||
|
ESP_LOGE(TAG, "Failed to deinit Wi-Fi driver (0x%x)", err);
|
||||||
|
}
|
||||||
|
|
||||||
|
tcpip_adapter_clear_default_wifi_handlers();
|
||||||
|
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
esp_err_t esp_wifi_init(const wifi_init_config_t *config)
|
esp_err_t esp_wifi_init(const wifi_init_config_t *config)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_PM_ENABLE
|
#ifdef CONFIG_PM_ENABLE
|
||||||
|
@@ -54,6 +54,16 @@ const mesh_crypto_funcs_t g_wifi_default_mesh_crypto_funcs;
|
|||||||
*/
|
*/
|
||||||
esp_err_t esp_supplicant_init(void);
|
esp_err_t esp_supplicant_init(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Supplicant deinitialization
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* - ESP_OK : succeed
|
||||||
|
* - others: failed
|
||||||
|
*/
|
||||||
|
esp_err_t esp_supplicant_deinit(void);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
@@ -232,7 +232,7 @@ int esp_supplicant_init(void)
|
|||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wpa_hook_deinit(void)
|
int esp_supplicant_deinit(void)
|
||||||
{
|
{
|
||||||
return esp_wifi_unregister_wpa_cb_internal();
|
return esp_wifi_unregister_wpa_cb_internal();
|
||||||
}
|
}
|
||||||
|
@@ -83,9 +83,9 @@ build_template_app:
|
|||||||
- export EXTRA_CXXFLAGS=${PEDANTIC_CXXFLAGS}
|
- export EXTRA_CXXFLAGS=${PEDANTIC_CXXFLAGS}
|
||||||
|
|
||||||
# Check if there are any stray printf/ets_printf references in WiFi libs
|
# Check if there are any stray printf/ets_printf references in WiFi libs
|
||||||
- pushd ../components/esp_wifi/lib_esp32
|
- pushd ../components/esp_wifi/lib
|
||||||
- test $(xtensa-esp32-elf-nm *.a | grep -w printf | wc -l) -eq 0
|
- for dir in esp32 esp32s2beta; do test $(xtensa-esp32-elf-nm $dir/*.a | grep -w printf | wc -l) -eq 0; done;
|
||||||
- test $(xtensa-esp32-elf-nm *.a | grep -w ets_printf | wc -l) -eq 0
|
- for dir in esp32 esp32s2beta; do test $(xtensa-esp32-elf-nm $dir/*.a | grep -w ets_printf | wc -l) -eq 0; done;
|
||||||
- popd
|
- popd
|
||||||
|
|
||||||
build_ssc:
|
build_ssc:
|
||||||
|
Reference in New Issue
Block a user