From bd9bf585d3750998161eeb8f2371ad7bec3330b9 Mon Sep 17 00:00:00 2001 From: Vladislav Osmanov <7123463+osmanovv@users.noreply.github.com> Date: Wed, 15 Sep 2021 12:09:11 +0300 Subject: [PATCH] save channel & freq before outputting them for debugging The frequency could be overridden in `RadioInterface::getFreq()` for some modules. --- src/mesh/RadioInterface.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesh/RadioInterface.cpp b/src/mesh/RadioInterface.cpp index 4bd352559..cf86ae01c 100644 --- a/src/mesh/RadioInterface.cpp +++ b/src/mesh/RadioInterface.cpp @@ -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); } /**