mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-20 09:43:03 +00:00
Allow advanced users to set arbitrary spreadfactor/codingrate/bandwidth
This commit is contained in:
@@ -115,22 +115,26 @@ unsigned long hash(char *str)
|
||||
return hash;
|
||||
}
|
||||
|
||||
#define POWER_DEFAULT 17
|
||||
|
||||
/**
|
||||
* Pull our channel settings etc... from protobufs to the dumb interface settings
|
||||
*/
|
||||
void RadioInterface::applyModemConfig()
|
||||
{
|
||||
// Set up default configuration
|
||||
// No Sync Words in LORA mode.
|
||||
modemConfig = (ModemConfigChoice)channelSettings.modem_config;
|
||||
// No Sync Words in LORA mode
|
||||
|
||||
power = channelSettings.tx_power;
|
||||
if (power == 0)
|
||||
power = POWER_DEFAULT;
|
||||
|
||||
// Defaults after init are 434.0MHz, modulation GFSK_Rb250Fd250, +13dbM
|
||||
int channel_num = hash(channelSettings.name) % NUM_CHANNELS;
|
||||
freq = CH0 + CH_SPACING * channel_num;
|
||||
power = channelSettings.tx_power;
|
||||
|
||||
DEBUG_MSG("Set radio: name=%s, config=%u, ch=%d, power=%d\n", channelSettings.name, channelSettings.modem_config, channel_num,
|
||||
channelSettings.tx_power);
|
||||
power);
|
||||
}
|
||||
|
||||
ErrorCode SimRadio::send(MeshPacket *p)
|
||||
|
||||
Reference in New Issue
Block a user