From ef1aedd5699110d3bd911ca25bbdd22693caca43 Mon Sep 17 00:00:00 2001 From: Jason P Date: Thu, 23 Jul 2026 03:08:34 -0500 Subject: [PATCH] Fixes a crash when you favorite a node (#11146) Co-authored-by: Ben Meadors --- src/mesh/MeshService.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/mesh/MeshService.cpp b/src/mesh/MeshService.cpp index c7148c59f..689d5847c 100644 --- a/src/mesh/MeshService.cpp +++ b/src/mesh/MeshService.cpp @@ -137,12 +137,17 @@ void MeshService::loop() /// The radioConfig object just changed, call this to force the hw to change to the new settings void MeshService::reloadConfig(int saveWhat) { - // If we can successfully set this radio to these settings, save them to disk + // Only LoRa config and channels (freq/PSK/slot) affect the radio. Saves that only touch + // module config, device state, or the node database (e.g. favoriting a node) have no reason + // to re-init the LoRa chip - skip it there to avoid an unnecessary and risky SPI reconfigure. + if (saveWhat & (SEGMENT_CONFIG | SEGMENT_CHANNELS)) { + // If we can successfully set this radio to these settings, save them to disk - // This will also update the region as needed - nodeDB->resetRadioConfig(); // Don't let the phone send us fatally bad settings + // This will also update the region as needed + nodeDB->resetRadioConfig(); // Don't let the phone send us fatally bad settings - configChanged.notifyObservers(NULL); // This will cause radio hardware to change freqs etc + configChanged.notifyObservers(NULL); // This will cause radio hardware to change freqs etc + } nodeDB->saveToDisk(saveWhat); }