From 304a655804c77ea6e8cf1b94f259a9db830b6840 Mon Sep 17 00:00:00 2001 From: Zhang Hai Peng Date: Mon, 9 Dec 2024 17:45:33 +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 6fe2154eff..660a0960a0 100644 --- a/components/bt/controller/esp32/bt.c +++ b/components/bt/controller/esp32/bt.c @@ -1345,7 +1345,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 d9d4fa85a7..c14c03a64e 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 */ @@ -313,7 +313,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. */ @@ -321,7 +321,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: