1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-05 21:02:20 +01:00

Use arduino btStart for arduino framework (#2457)

This commit is contained in:
Jesse Hills
2021-10-11 10:38:45 +13:00
committed by GitHub
parent 42739f0b22
commit 2c517e3e8c
3 changed files with 25 additions and 0 deletions

View File

@@ -56,6 +56,12 @@ bool ESP32BLE::ble_setup_() {
return false;
}
#ifdef USE_ARDUINO
if (!btStart()) {
ESP_LOGE(TAG, "btStart failed: %d", esp_bt_controller_get_status());
return false;
}
#else
if (esp_bt_controller_get_status() != ESP_BT_CONTROLLER_STATUS_ENABLED) {
// start bt controller
if (esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_IDLE) {
@@ -80,6 +86,7 @@ bool ESP32BLE::ble_setup_() {
return false;
}
}
#endif
esp_bt_controller_mem_release(ESP_BT_MODE_CLASSIC_BT);