save channel & freq before outputting them for debugging

The frequency could be overridden in `RadioInterface::getFreq()` for some modules.
This commit is contained in:
Vladislav Osmanov 2021-09-15 12:09:11 +03:00
parent 56dd3eab23
commit bd9bf585d3

View File

@ -320,6 +320,9 @@ void RadioInterface::applyModemConfig()
int channel_num = channelSettings.channel_num ? channelSettings.channel_num - 1 : hash(channelName) % myRegion->numChannels;
float freq = myRegion->freq + radioConfig.preferences.frequency_offset + myRegion->spacing * channel_num;
saveChannelNum(channel_num);
saveFreq(freq);
DEBUG_MSG("Set radio: name=%s, config=%u, ch=%d, power=%d\n", channelName, channelSettings.modem_config, channel_num, power);
DEBUG_MSG("Radio myRegion->freq: %f\n", myRegion->freq);
DEBUG_MSG("Radio myRegion->spacing: %f\n", myRegion->spacing);
@ -327,9 +330,6 @@ void RadioInterface::applyModemConfig()
DEBUG_MSG("Radio channel_num: %d\n", channel_num);
DEBUG_MSG("Radio frequency: %f\n", getFreq()); // the frequency could be overridden in RadioInterface::getFreq() for some modules
DEBUG_MSG("Short packet time: %u msec\n", shortPacketMsec);
saveChannelNum(channel_num);
saveFreq(freq);
}
/**