TNC mode checks

This commit is contained in:
Mark Qvist 2018-06-20 17:45:22 +02:00
parent 720f34d41f
commit 3deab29845
2 changed files with 10 additions and 5 deletions

View File

@ -9,6 +9,9 @@
#define MCU_328P 0x90
#define MCU_1284P 0x91
#define MODE_HOST 0x11
#define MODE_TNC 0x12
#if defined(__AVR_ATmega328P__)
#define MCU_VARIANT MCU_328P
#warning "Firmware is being compiled for atmega328p based boards"
@ -72,6 +75,7 @@
bool radio_locked = true;
bool radio_online = false;
bool hw_ready = false;
uint8_t op_mode = MODE_HOST;
uint8_t model = 0x00;
uint8_t hwrev = 0x00;

View File

@ -232,7 +232,7 @@ void serialCallback(uint8_t sbyte) {
kiss_indicate_frequency();
} else {
lora_freq = freq;
setFrequency();
if (op_mode == MODE_HOST) setFrequency();
kiss_indicate_frequency();
}
}
@ -255,7 +255,7 @@ void serialCallback(uint8_t sbyte) {
kiss_indicate_bandwidth();
} else {
lora_bw = bw;
setBandwidth();
if (op_mode == MODE_HOST) setBandwidth();
kiss_indicate_bandwidth();
}
}
@ -267,7 +267,7 @@ void serialCallback(uint8_t sbyte) {
if (txp > 17) txp = 17;
lora_txp = txp;
setTXPower();
if (op_mode == MODE_HOST) setTXPower();
kiss_indicate_txpower();
}
} else if (command == CMD_SF) {
@ -279,7 +279,7 @@ void serialCallback(uint8_t sbyte) {
if (sf > 12) sf = 12;
lora_sf = sf;
setSpreadingFactor();
if (op_mode == MODE_HOST) setSpreadingFactor();
kiss_indicate_spreadingfactor();
}
} else if (command == CMD_CR) {
@ -291,7 +291,7 @@ void serialCallback(uint8_t sbyte) {
if (cr > 8) cr = 8;
lora_cr = cr;
setCodingRate();
if (op_mode == MODE_HOST) setCodingRate();
kiss_indicate_codingrate();
}
} else if (command == CMD_RADIO_STATE) {
@ -397,6 +397,7 @@ void validateStatus() {
if (eeprom_have_conf()) {
eeprom_conf_load();
op_mode = MODE_TNC;
startRadio();
}
}