Fix blufi crash caused by the break change

This commit is contained in:
GengYuchao
2022-07-11 11:04:44 +08:00
parent 6db79c3950
commit f34b3912b0

View File

@@ -109,7 +109,13 @@ void bleprph_host_task(void *param)
esp_err_t esp_blufi_host_init(void) 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. */ /* Initialize the NimBLE host configuration. */
ble_hs_cfg.reset_cb = blufi_on_reset; ble_hs_cfg.reset_cb = blufi_on_reset;
ble_hs_cfg.sync_cb = blufi_on_sync; ble_hs_cfg.sync_cb = blufi_on_sync;
@@ -146,7 +152,11 @@ esp_err_t esp_blufi_host_init(void)
esp_blufi_btc_init(); 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; return ESP_OK;
} }