[codex] Fix ESP32 Paxcounter startup with Bluetooth disabled (#10871)

* Fix ESP32 paxcounter startup with Bluetooth disabled

* Address paxcounter startup review feedback
This commit is contained in:
Benjamin Faershtein
2026-07-03 18:58:32 -05:00
committed by GitHub
parent c8f2ea16f0
commit f8a9ae9f55
2 changed files with 56 additions and 4 deletions
+17
View File
@@ -52,8 +52,25 @@ static bool isNetworkConfiguredToDisableBluetooth()
#endif
}
static bool isPaxcounterActiveForBoot()
{
#if !MESHTASTIC_EXCLUDE_PAXCOUNTER
return moduleConfig.has_paxcounter && moduleConfig.paxcounter.enabled && !config.bluetooth.enabled &&
!config.network.wifi_enabled;
#else
return false;
#endif
}
static bool shouldReleaseBluetoothMemory()
{
// Paxcounter disables the Meshtastic BLE service, but libpax still needs the
// ESP32 BLE controller memory for scanning.
if (isPaxcounterActiveForBoot()) {
LOG_DEBUG("Skipping Bluetooth memory release because Paxcounter is active");
return false;
}
// On ESP32 targets WiFi and BLE share radio resources. When WiFi is configured for this boot,
// BLE will not be started, so its reserved memory can be returned to the heap until reboot.
if (isNetworkConfiguredToDisableBluetooth()) {