Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/mesh/MeshService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
Loading