ble: update controller log module

This commit is contained in:
luomanruo
2023-11-17 11:13:50 +08:00
committed by BOT
parent 30cd76b0f0
commit 1c261213d7

View File

@@ -646,6 +646,12 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
coex_init();
#endif
ret = ble_controller_init(cfg);
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_init failed %d", ret);
goto modem_deint;
}
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
interface_func_t bt_controller_log_interface;
bt_controller_log_interface = esp_bt_controller_log_interface;
@@ -667,12 +673,6 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
}
#endif // CONFIG_BT_CONTROLLER_LOG_ENABLED
ret = ble_controller_init(cfg);
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_init failed %d", ret);
goto modem_deint;
}
ret = controller_sleep_init();
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "controller_sleep_init failed %d", ret);
@@ -693,11 +693,11 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
return ESP_OK;
free_controller:
controller_sleep_deinit();
ble_controller_deinit();
modem_deint:
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
ble_log_deinit_async();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
ble_controller_deinit();
esp_phy_modem_deinit();
periph_module_disable(PERIPH_BT_MODULE);
#if CONFIG_BT_NIMBLE_ENABLED