Skip to content

Commit f25563e

Browse files
committed
bt: update driver
1 parent 92c9f2a commit f25563e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

main/src/device/bt.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,27 @@
1414
#include "esp_bt_device.h"
1515
#include "esp_log.h"
1616

17-
char bt0_addr_str[18] = {0};
18-
1917
#define TAG "bt-0"
2018

2119
void bt0_init(void)
2220
{
21+
#if defined(CONFIG_ENABLE_BLUFI)
2322
ESP_ERROR_CHECK(esp_bt_controller_mem_release(ESP_BT_MODE_CLASSIC_BT));
2423
esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();
2524
ESP_ERROR_CHECK(esp_bt_controller_init(&bt_cfg));
2625
ESP_ERROR_CHECK(esp_bt_controller_enable(ESP_BT_MODE_BLE));
2726
ESP_ERROR_CHECK(esp_bluedroid_init());
2827
ESP_ERROR_CHECK(esp_bluedroid_enable());
29-
snprintf(bt0_addr_str, sizeof(bt0_addr_str), ""ESP_BD_ADDR_STR"", ESP_BD_ADDR_HEX(esp_bt_dev_get_address()));
28+
#else
29+
ESP_ERROR_CHECK(esp_bt_controller_mem_release(ESP_BT_MODE_BTDM));
30+
#endif
3031
}
3132

3233
void bt0_deinit(void)
3334
{
34-
#if defined(CONFIG_ENABLE_BLUFI)
3535
ESP_ERROR_CHECK(esp_bluedroid_disable());
3636
ESP_ERROR_CHECK(esp_bluedroid_deinit());
3737
ESP_ERROR_CHECK(esp_bt_controller_disable());
3838
ESP_ERROR_CHECK(esp_bt_controller_deinit());
39-
#endif
4039
ESP_ERROR_CHECK(esp_bt_controller_mem_release(ESP_BT_MODE_BTDM));
4140
}

0 commit comments

Comments
 (0)