From 00f6929123ee6ad7fde356926d4bb0b0a53fccfd Mon Sep 17 00:00:00 2001 From: Zhang Hai Peng Date: Mon, 9 Dec 2024 17:45:19 +0800 Subject: [PATCH] fix(blufi): Fixed blufi init fail after deinit (cherry picked from commit 7addb57ccd53576b40d3cfeb24c185036053f4b4) Co-authored-by: zhanghaipeng --- components/bt/controller/esp32/bt.c | 3 ++- examples/bluetooth/blufi/main/blufi_example_main.c | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/components/bt/controller/esp32/bt.c b/components/bt/controller/esp32/bt.c index 4aae2014ad..f017bd2e49 100644 --- a/components/bt/controller/esp32/bt.c +++ b/components/bt/controller/esp32/bt.c @@ -1397,7 +1397,8 @@ static esp_err_t esp_bt_controller_rom_mem_release(esp_bt_mode_t mode) //already released if (!(mode & btdm_dram_available_region[0].mode)) { - return ESP_ERR_INVALID_STATE; + ESP_LOGW(BTDM_LOG_TAG, "%s already released, mode %d",__func__, mode); + return ESP_OK; } for (int i = 0; i < sizeof(btdm_dram_available_region)/sizeof(btdm_dram_available_region_t); i++) { diff --git a/examples/bluetooth/blufi/main/blufi_example_main.c b/examples/bluetooth/blufi/main/blufi_example_main.c index 59f9ffd4a8..dbb2b818af 100644 --- a/examples/bluetooth/blufi/main/blufi_example_main.c +++ b/examples/bluetooth/blufi/main/blufi_example_main.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Unlicense OR CC0-1.0 */ @@ -311,7 +311,7 @@ static void example_event_callback(esp_blufi_cb_event_t event, esp_blufi_cb_para ESP_ERROR_CHECK( esp_wifi_set_mode(param->wifi_mode.op_mode) ); break; case ESP_BLUFI_EVENT_REQ_CONNECT_TO_AP: - BLUFI_INFO("BLUFI requset wifi connect to AP\n"); + BLUFI_INFO("BLUFI request wifi connect to AP\n"); /* there is no wifi callback when the device has already connected to this wifi so disconnect wifi before connection. */ @@ -319,7 +319,7 @@ static void example_event_callback(esp_blufi_cb_event_t event, esp_blufi_cb_para example_wifi_connect(); break; case ESP_BLUFI_EVENT_REQ_DISCONNECT_FROM_AP: - BLUFI_INFO("BLUFI requset wifi disconnect from AP\n"); + BLUFI_INFO("BLUFI request wifi disconnect from AP\n"); esp_wifi_disconnect(); break; case ESP_BLUFI_EVENT_REPORT_ERROR: