sforkowany z mirror/meshtastic-firmware
commit
50300957db
|
@ -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
|
// 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());
|
const char *channelName = channels.getName(channels.getPrimaryIndex());
|
||||||
int channel_num = channelSettings.channel_num ? channelSettings.channel_num - 1 : hash(channelName) % numChannels;
|
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);
|
saveChannelNum(channel_num);
|
||||||
saveFreq(freq + config.lora.frequency_offset);
|
saveFreq(freq + config.lora.frequency_offset);
|
||||||
|
|
Ładowanie…
Reference in New Issue