mirror of
https://github.com/espressif/esp-idf
synced 2025-03-11 10:09:08 -04:00
fix(blufi): Fixed blufi init fail after deinit
(cherry picked from commit 7addb57ccd53576b40d3cfeb24c185036053f4b4) Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
This commit is contained in:
parent
338b3744e6
commit
a91f9b2395
@ -1345,7 +1345,8 @@ static esp_err_t esp_bt_controller_rom_mem_release(esp_bt_mode_t mode)
|
|||||||
|
|
||||||
//already released
|
//already released
|
||||||
if (!(mode & btdm_dram_available_region[0].mode)) {
|
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++) {
|
for (int i = 0; i < sizeof(btdm_dram_available_region)/sizeof(btdm_dram_available_region_t); i++) {
|
||||||
|
@ -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
|
* 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) );
|
ESP_ERROR_CHECK( esp_wifi_set_mode(param->wifi_mode.op_mode) );
|
||||||
break;
|
break;
|
||||||
case ESP_BLUFI_EVENT_REQ_CONNECT_TO_AP:
|
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
|
/* there is no wifi callback when the device has already connected to this wifi
|
||||||
so disconnect wifi before connection.
|
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();
|
example_wifi_connect();
|
||||||
break;
|
break;
|
||||||
case ESP_BLUFI_EVENT_REQ_DISCONNECT_FROM_AP:
|
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();
|
esp_wifi_disconnect();
|
||||||
break;
|
break;
|
||||||
case ESP_BLUFI_EVENT_REPORT_ERROR:
|
case ESP_BLUFI_EVENT_REPORT_ERROR:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user