Merge pull request #1782 from meshtastic/lora-freq-check

Lora freq check
This commit is contained in:
Thomas Göttgens 2022-10-10 12:53:14 +02:00 committed by GitHub
commit 62c809a596
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -422,7 +422,7 @@ 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 = loraConfig.channel_num ? loraConfig.channel_num - 1 : hash(channelName) % numChannels;
int channel_num = (loraConfig.channel_num ? loraConfig.channel_num - 1 : hash(channelName)) % numChannels;
// Old frequency selection formula
// float freq = myRegion->freqStart + ((((myRegion->freqEnd - myRegion->freqStart) / numChannels) / 2) * channel_num);