Skip to content

Commit

Permalink
[ESP32] Release BTDM memory rather than just releasing BLE memory. (#…
Browse files Browse the repository at this point in the history
…23165)

Once we are done using BLE for commissioning we should release all the
bluetooth memory. Releasing with mode ESP_BT_MODE_BLE do not release
all the memory. Releasing memory with mode ESP_BT_MODE_BLE will give us
approx. ~3K of heap onf ESP32 SOC.
  • Loading branch information
shubhamdp authored and pull[bot] committed Sep 25, 2023
1 parent 78c395f commit 5610757
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/platform/esp32/common/CommonDeviceCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void CommonDeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, i
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)
err = esp_nimble_hci_and_controller_deinit();
#endif // ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)
err += esp_bt_mem_release(ESP_BT_MODE_BLE);
err += esp_bt_mem_release(ESP_BT_MODE_BTDM);
if (err == ESP_OK)
{
ESP_LOGI(TAG, "BLE deinit successful and memory reclaimed");
Expand Down

0 comments on commit 5610757

Please sign in to comment.