Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions cores/esp32/esp32-hal-bt.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
#if SOC_BT_SUPPORTED
#ifdef CONFIG_BT_BLUEDROID_ENABLED

#if __has_include("esp_bt.h")
#include "esp_bt.h"

#if CONFIG_IDF_TARGET_ESP32
bool btInUse() {
return true;
Expand All @@ -28,8 +31,6 @@ __attribute__((weak)) bool btInUse() {
}
#endif

#include "esp_bt.h"

#ifdef CONFIG_BTDM_CONTROLLER_MODE_BTDM
#define BT_MODE ESP_BT_MODE_BTDM
#elif defined(CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY)
Expand All @@ -56,7 +57,7 @@ bool btStartMode(bt_mode mode) {
case BT_MODE_BTDM: esp_bt_mode = ESP_BT_MODE_BTDM; break;
default: esp_bt_mode = BT_MODE; break;
}
// esp_bt_controller_enable(MODE) This mode must be equal as the mode in cfg of esp_bt_controller_init().
// esp_bt_controller_enable(MODE) This mode must be equal as the mode in "cfg" of esp_bt_controller_init().
cfg.mode = esp_bt_mode;
if (cfg.mode == ESP_BT_MODE_CLASSIC_BT) {
esp_bt_controller_mem_release(ESP_BT_MODE_BLE);
Expand Down Expand Up @@ -116,6 +117,7 @@ bool btStop() {
return false;
}

#endif // __has_include("esp_bt.h")
#else // CONFIG_BT_ENABLED
bool btStarted() {
return false;
Expand All @@ -132,3 +134,4 @@ bool btStop() {
#endif /* CONFIG_BT_ENABLED */

#endif /* SOC_BT_SUPPORTED */

Loading