mirror of
https://github.com/alexhopeoconnor/firmware.git
synced 2026-10-20 18:31:28 +10:00
[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:
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user