Update main.cpp
This commit is contained in:
parent
5548789c19
commit
22c580fad6
12
src/main.cpp
12
src/main.cpp
|
@ -4,7 +4,7 @@
|
|||
|
||||
// CONFIGURATION: change values in config.h !
|
||||
#define VERBOSE // define to SILENT to turn off serial messages
|
||||
#define BLINK // define to NOBLINK to turn off LED signaling
|
||||
#define NOBLINK // define to NOBLINK to turn off LED signaling
|
||||
|
||||
MeshPacket thePacket;
|
||||
ChannelSettings ChanSet;
|
||||
|
@ -33,8 +33,9 @@ void setup() {
|
|||
Radio.Init( &RadioEvents );
|
||||
Radio.Sleep();
|
||||
memcpy(ChanSet.name, MESHTASTIC_NAME, 12);
|
||||
ChanSet.channel_num = hash( MESHTASTIC_NAME ) % myRegion[REGION].numChannels; // see config.h
|
||||
ChanSet.tx_power = (myRegion[REGION].powerLimit == 0) ? TX_MAX_POWER : myRegion[REGION].powerLimit;
|
||||
REGION -= 1;
|
||||
ChanSet.channel_num = hash( MESHTASTIC_NAME ) % regions[REGION].numChannels; // see config.h
|
||||
ChanSet.tx_power = (regions[REGION].powerLimit == 0) ? TX_MAX_POWER : regions[REGION].powerLimit ;
|
||||
if (ChanSet.tx_power > TX_MAX_POWER) ChanSet.tx_power = TX_MAX_POWER;
|
||||
ChanSet.psk = MESHTASTIC_PSK;
|
||||
/* FYI:
|
||||
|
@ -182,9 +183,9 @@ unsigned long hash(char *str)
|
|||
|
||||
void ConfigureRadio( ChannelSettings ChanSet )
|
||||
{
|
||||
uint32_t freq = (uint32_t)(myRegion[REGION].freq + myRegion[REGION].spacing * ChanSet.channel_num)*1E6;
|
||||
uint32_t freq = (regions[REGION].freq + regions[REGION].spacing * ChanSet.channel_num)*1E6;
|
||||
#ifndef SILENT
|
||||
MSG("\nRegion is: %s\n",myRegion[REGION].code);
|
||||
MSG("\nRegion is: %s\n",regions[REGION].name);
|
||||
MSG("Setting frequency to %i Hz (meshtastic channel %i) .. \n",freq,ChanSet.channel_num );
|
||||
MSG("Channel name is: %s .. \n", ChanSet.name );
|
||||
MSG("Setting bandwidth to index %i ..\n",ChanSet.bandwidth);
|
||||
|
@ -198,3 +199,4 @@ void ConfigureRadio( ChannelSettings ChanSet )
|
|||
Radio.SetRxConfig( MODEM_LORA, ChanSet.bandwidth, ChanSet.spread_factor, ChanSet.coding_rate, 0, LORA_PREAMBLE_LENGTH,
|
||||
LORA_SYMBOL_TIMEOUT, false , 0, true, false, 0, false, true );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue