mirror of
https://github.com/liberatedsystems/RNode_Firmware_CE.git
synced 2024-07-02 14:34:13 +02:00
TNC mode checks
This commit is contained in:
parent
720f34d41f
commit
3deab29845
4
Config.h
4
Config.h
@ -9,6 +9,9 @@
|
|||||||
#define MCU_328P 0x90
|
#define MCU_328P 0x90
|
||||||
#define MCU_1284P 0x91
|
#define MCU_1284P 0x91
|
||||||
|
|
||||||
|
#define MODE_HOST 0x11
|
||||||
|
#define MODE_TNC 0x12
|
||||||
|
|
||||||
#if defined(__AVR_ATmega328P__)
|
#if defined(__AVR_ATmega328P__)
|
||||||
#define MCU_VARIANT MCU_328P
|
#define MCU_VARIANT MCU_328P
|
||||||
#warning "Firmware is being compiled for atmega328p based boards"
|
#warning "Firmware is being compiled for atmega328p based boards"
|
||||||
@ -72,6 +75,7 @@
|
|||||||
bool radio_locked = true;
|
bool radio_locked = true;
|
||||||
bool radio_online = false;
|
bool radio_online = false;
|
||||||
bool hw_ready = false;
|
bool hw_ready = false;
|
||||||
|
uint8_t op_mode = MODE_HOST;
|
||||||
uint8_t model = 0x00;
|
uint8_t model = 0x00;
|
||||||
uint8_t hwrev = 0x00;
|
uint8_t hwrev = 0x00;
|
||||||
|
|
||||||
|
@ -232,7 +232,7 @@ void serialCallback(uint8_t sbyte) {
|
|||||||
kiss_indicate_frequency();
|
kiss_indicate_frequency();
|
||||||
} else {
|
} else {
|
||||||
lora_freq = freq;
|
lora_freq = freq;
|
||||||
setFrequency();
|
if (op_mode == MODE_HOST) setFrequency();
|
||||||
kiss_indicate_frequency();
|
kiss_indicate_frequency();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -255,7 +255,7 @@ void serialCallback(uint8_t sbyte) {
|
|||||||
kiss_indicate_bandwidth();
|
kiss_indicate_bandwidth();
|
||||||
} else {
|
} else {
|
||||||
lora_bw = bw;
|
lora_bw = bw;
|
||||||
setBandwidth();
|
if (op_mode == MODE_HOST) setBandwidth();
|
||||||
kiss_indicate_bandwidth();
|
kiss_indicate_bandwidth();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -267,7 +267,7 @@ void serialCallback(uint8_t sbyte) {
|
|||||||
if (txp > 17) txp = 17;
|
if (txp > 17) txp = 17;
|
||||||
|
|
||||||
lora_txp = txp;
|
lora_txp = txp;
|
||||||
setTXPower();
|
if (op_mode == MODE_HOST) setTXPower();
|
||||||
kiss_indicate_txpower();
|
kiss_indicate_txpower();
|
||||||
}
|
}
|
||||||
} else if (command == CMD_SF) {
|
} else if (command == CMD_SF) {
|
||||||
@ -279,7 +279,7 @@ void serialCallback(uint8_t sbyte) {
|
|||||||
if (sf > 12) sf = 12;
|
if (sf > 12) sf = 12;
|
||||||
|
|
||||||
lora_sf = sf;
|
lora_sf = sf;
|
||||||
setSpreadingFactor();
|
if (op_mode == MODE_HOST) setSpreadingFactor();
|
||||||
kiss_indicate_spreadingfactor();
|
kiss_indicate_spreadingfactor();
|
||||||
}
|
}
|
||||||
} else if (command == CMD_CR) {
|
} else if (command == CMD_CR) {
|
||||||
@ -291,7 +291,7 @@ void serialCallback(uint8_t sbyte) {
|
|||||||
if (cr > 8) cr = 8;
|
if (cr > 8) cr = 8;
|
||||||
|
|
||||||
lora_cr = cr;
|
lora_cr = cr;
|
||||||
setCodingRate();
|
if (op_mode == MODE_HOST) setCodingRate();
|
||||||
kiss_indicate_codingrate();
|
kiss_indicate_codingrate();
|
||||||
}
|
}
|
||||||
} else if (command == CMD_RADIO_STATE) {
|
} else if (command == CMD_RADIO_STATE) {
|
||||||
@ -397,6 +397,7 @@ void validateStatus() {
|
|||||||
|
|
||||||
if (eeprom_have_conf()) {
|
if (eeprom_have_conf()) {
|
||||||
eeprom_conf_load();
|
eeprom_conf_load();
|
||||||
|
op_mode = MODE_TNC;
|
||||||
startRadio();
|
startRadio();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user