[feature] Free a little memory used by bluetooth if wifi is enabled or bluetooth is disabled (#10398)

* esp32: release BTDM heap when Bluetooth inactive

Release ESP-IDF BTDM memory after config load when Bluetooth is disabled or WiFi is enabled, recovering heap on ESP32 targets where BLE won’t be used for this boot.

* Address BT memory release review comments

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
Clive BlackledgeandBen Meadors authored and GitHub committed 2026-06-25 17:05:27 -05:00
1 parent f1b1e35a79
commit 98fa4a67db
4 files changed
+82 -1

No files matched your search

+1
View File
@@ -1753,6 +1753,7 @@ void disableBluetooth()
#ifdef ARCH_ESP32
if (nimbleBluetooth)
nimbleBluetooth->deinit();
esp32ReleaseBluetoothMemoryIfUnused();
#elif defined(ARCH_NRF52)
if (nrf52Bluetooth)
nrf52Bluetooth->shutdown();