Fixes a crash when you favorite a node (#11146)

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
Jason P
2026-07-23 10:08:34 +02:00
committed by GitHub
co-authored by GitHub Ben Meadors
parent efc9708236
commit ef1aedd569
+9 -4
View File
@@ -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);
}