From f34b3912b099f9b2e07feef729ee478e7ce0180a Mon Sep 17 00:00:00 2001 From: GengYuchao Date: Mon, 11 Jul 2022 11:04:44 +0800 Subject: [PATCH] Fix blufi crash caused by the break change --- examples/bluetooth/blufi/main/blufi_init.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/examples/bluetooth/blufi/main/blufi_init.c b/examples/bluetooth/blufi/main/blufi_init.c index f942dc1aaf..46b3af3d85 100644 --- a/examples/bluetooth/blufi/main/blufi_init.c +++ b/examples/bluetooth/blufi/main/blufi_init.c @@ -109,7 +109,13 @@ void bleprph_host_task(void *param) esp_err_t esp_blufi_host_init(void) { - nimble_port_init(); + esp_err_t err; + err = esp_nimble_init(); + if (err) { + BLUFI_ERROR("%s failed: %s\n", __func__, esp_err_to_name(err)); + return ESP_FAIL; + } + /* Initialize the NimBLE host configuration. */ ble_hs_cfg.reset_cb = blufi_on_reset; ble_hs_cfg.sync_cb = blufi_on_sync; @@ -146,7 +152,11 @@ esp_err_t esp_blufi_host_init(void) esp_blufi_btc_init(); - nimble_port_freertos_init(bleprph_host_task); + err = esp_nimble_enable(bleprph_host_task); + if (err) { + BLUFI_ERROR("%s failed: %s\n", __func__, esp_err_to_name(err)); + return ESP_FAIL; + } return ESP_OK; }