From 1174199043f7441c269d2f02069146fdabaab81b Mon Sep 17 00:00:00 2001 From: Shubham Patil Date: Thu, 6 Oct 2022 17:33:39 +0530 Subject: [PATCH] [ESP32] Reclaim the BLE memory as heap (#23046) --- src/platform/ESP32/nimble/BLEManagerImpl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/platform/ESP32/nimble/BLEManagerImpl.cpp b/src/platform/ESP32/nimble/BLEManagerImpl.cpp index ea4f5c1de99d32..3f5318ab9fec4e 100644 --- a/src/platform/ESP32/nimble/BLEManagerImpl.cpp +++ b/src/platform/ESP32/nimble/BLEManagerImpl.cpp @@ -39,6 +39,7 @@ #include #include +#include "esp_bt.h" #include "esp_log.h" #if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) #include "esp_nimble_hci.h" @@ -145,15 +146,14 @@ CHIP_ERROR BLEManagerImpl::_Init() if (ConnectivityMgr().IsThreadProvisioned()) { ESP_LOGI(TAG, "Thread credentials already provisioned, not initializing BLE"); - return CHIP_NO_ERROR; - } #else if (ConnectivityMgr().IsWiFiStationProvisioned()) { ESP_LOGI(TAG, "WiFi station already provisioned, not initializing BLE"); +#endif /* CHIP_DEVICE_CONFIG_ENABLE_THREAD */ + esp_bt_mem_release(ESP_BT_MODE_BTDM); return CHIP_NO_ERROR; } -#endif /* CHIP_DEVICE_CONFIG_ENABLE_THREAD */ #endif /* CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING */ CHIP_ERROR err;