diff --git a/src/mesh/RadioInterface.cpp b/src/mesh/RadioInterface.cpp index 109a5f52..6005147e 100644 --- a/src/mesh/RadioInterface.cpp +++ b/src/mesh/RadioInterface.cpp @@ -421,7 +421,12 @@ void RadioInterface::applyModemConfig() // If user has manually specified a channel num, then use that, otherwise generate one by hashing the name const char *channelName = channels.getName(channels.getPrimaryIndex()); int channel_num = channelSettings.channel_num ? channelSettings.channel_num - 1 : hash(channelName) % numChannels; - float freq = myRegion->freqStart + ((((myRegion->freqEnd - myRegion->freqStart) / numChannels) / 2) * channel_num); + + // Old frequency selection formula + // float freq = myRegion->freqStart + ((((myRegion->freqEnd - myRegion->freqStart) / numChannels) / 2) * channel_num); + + // New frequency selection formula + float freq = myRegion->freqStart + (bw / 2) + ( channel_num * bw); saveChannelNum(channel_num); saveFreq(freq + config.lora.frequency_offset);