mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-09 14:42:05 +00:00
fix channel_num log (#2361)
* fix channel_num variable * fix channel_num log instead
This commit is contained in:
parent
b398f31b64
commit
7bbfa48b5d
@ -454,6 +454,7 @@ 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());
|
||||||
|
// channel_num is actually (channel_num - 1), since modulus (%) returns values from 0 to (numChannels - 1)
|
||||||
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
|
// Old frequency selection formula
|
||||||
@ -480,7 +481,7 @@ void RadioInterface::applyModemConfig()
|
|||||||
LOG_INFO("Radio myRegion->freqStart -> myRegion->freqEnd: %f -> %f (%f mhz)\n", myRegion->freqStart, myRegion->freqEnd,
|
LOG_INFO("Radio myRegion->freqStart -> myRegion->freqEnd: %f -> %f (%f mhz)\n", myRegion->freqStart, myRegion->freqEnd,
|
||||||
myRegion->freqEnd - myRegion->freqStart);
|
myRegion->freqEnd - myRegion->freqStart);
|
||||||
LOG_INFO("Radio myRegion->numChannels: %d x %.3fkHz\n", numChannels, bw);
|
LOG_INFO("Radio myRegion->numChannels: %d x %.3fkHz\n", numChannels, bw);
|
||||||
LOG_INFO("Radio channel_num: %d\n", channel_num);
|
LOG_INFO("Radio channel_num: %d\n", channel_num + 1);
|
||||||
LOG_INFO("Radio frequency: %f\n", getFreq());
|
LOG_INFO("Radio frequency: %f\n", getFreq());
|
||||||
LOG_INFO("Slot time: %u msec\n", slotTimeMsec);
|
LOG_INFO("Slot time: %u msec\n", slotTimeMsec);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user