Skip to content

Commit b24597a

Browse files
committed
Remove definition of btInUse().
This reverts a previous change @2e1d78ff that caused compiling/linking errors due to the redefinition of btInUse() when another linked library uses the Arduino bluetooth code.
1 parent 9961c56 commit b24597a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/NimBLEDevice.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131
#include "services/gatt/ble_svc_gatt.h"
3232

3333
#ifdef CONFIG_ENABLE_ARDUINO_DEPENDS
34-
extern "C" bool btInUse();
35-
bool btInUse(){ return true; }
34+
#include "esp32-hal-bt.h"
3635
#endif
3736

3837
#include "NimBLELog.h"
@@ -740,6 +739,12 @@ NimBLEAddress NimBLEDevice::getWhiteListAddress(size_t index) {
740739
if(!initialized){
741740
int rc=0;
742741
esp_err_t errRc = ESP_OK;
742+
743+
#ifdef CONFIG_ENABLE_ARDUINO_DEPENDS
744+
// make sure the linker includes esp32-hal-bt.c so ardruino init doesn't release BLE memory.
745+
btStarted();
746+
#endif
747+
743748
errRc = nvs_flash_init();
744749

745750
if (errRc == ESP_ERR_NVS_NO_FREE_PAGES || errRc == ESP_ERR_NVS_NEW_VERSION_FOUND) {

0 commit comments

Comments
 (0)