Skip to content

Commit e388050

Browse files
committed
Use include instead of defining btInUse function
1 parent 50f93c6 commit e388050

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

src/NimBLEDevice.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@
5454

5555
# if defined(ESP_PLATFORM) && defined(CONFIG_ENABLE_ARDUINO_DEPENDS)
5656
# include "esp32-hal-bt.h"
57+
# if __has_include("esp32-hal-bt-mem.h")
58+
# include "esp32-hal-bt-mem.h"
59+
# endif
5760
# endif
5861

5962
# include "NimBLELog.h"
@@ -909,7 +912,8 @@ bool NimBLEDevice::init(const std::string& deviceName) {
909912
bt_cfg.mode = ESP_BT_MODE_BLE;
910913
bt_cfg.ble_max_conn = CONFIG_BT_NIMBLE_MAX_CONNECTIONS;
911914
# elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32S3)
912-
bt_cfg.ble_max_act = MYNEWT_VAL(BLE_MAX_CONNECTIONS) + MYNEWT_VAL(BLE_ROLE_BROADCASTER) + MYNEWT_VAL(BLE_ROLE_OBSERVER);
915+
bt_cfg.ble_max_act =
916+
MYNEWT_VAL(BLE_MAX_CONNECTIONS) + MYNEWT_VAL(BLE_ROLE_BROADCASTER) + MYNEWT_VAL(BLE_ROLE_OBSERVER);
913917
# else
914918
bt_cfg.nimble_max_connections = CONFIG_BT_NIMBLE_MAX_CONNECTIONS;
915919
# endif
@@ -1347,10 +1351,4 @@ int NimBLEDeviceCallbacks::onStoreStatus(struct ble_store_status_event* event, v
13471351
return ble_store_util_status_rr(event, arg);
13481352
}
13491353

1350-
# if defined(CONFIG_ENABLE_ARDUINO_DEPENDS) && SOC_BT_SUPPORTED
1351-
bool btInUse(void) {
1352-
return true;
1353-
}
1354-
# endif
1355-
13561354
#endif // CONFIG_BT_ENABLED

0 commit comments

Comments
 (0)