mirror of
https://github.com/liberatedsystems/RNode_Firmware_CE.git
synced 2025-04-25 18:09:38 -04:00
Test RAK4631 and fix freeze from updating modem parameters when online
This commit is contained in:
parent
9c8f5cbfef
commit
8473594d02
2
Boards.h
2
Boards.h
@ -711,7 +711,7 @@
|
|||||||
#define INTERFACE_COUNT 1
|
#define INTERFACE_COUNT 1
|
||||||
|
|
||||||
// first interface in list is the primary
|
// first interface in list is the primary
|
||||||
const uint8_t interfaces[INTERFACE_COUNT] = {SX1262};
|
const uint8_t interfaces[INTERFACE_COUNT] = {INT_SX1262};
|
||||||
const bool interface_cfg[INTERFACE_COUNT][3] = {
|
const bool interface_cfg[INTERFACE_COUNT][3] = {
|
||||||
// SX1262
|
// SX1262
|
||||||
{
|
{
|
||||||
|
@ -578,8 +578,7 @@ bool startRadio(PhysicalLayer* radio, uint8_t index) {
|
|||||||
struct radio_vars* config = &radio_details[index];
|
struct radio_vars* config = &radio_details[index];
|
||||||
//update_radio_lock(radio);
|
//update_radio_lock(radio);
|
||||||
|
|
||||||
//if (modems_installed && !console_active) {
|
if (!config->radio_online) {
|
||||||
//if (!radio->getRadioLock() && hw_ready) {
|
|
||||||
|
|
||||||
int16_t status = 0;
|
int16_t status = 0;
|
||||||
switch (interfaces[index]) {
|
switch (interfaces[index]) {
|
||||||
@ -656,12 +655,13 @@ bool startRadio(PhysicalLayer* radio, uint8_t index) {
|
|||||||
// led_indicate_warning(3);
|
// led_indicate_warning(3);
|
||||||
// return false;
|
// return false;
|
||||||
//}
|
//}
|
||||||
//} else {
|
} else {
|
||||||
// // If radio is already on, we silently
|
// If the radio is already initialised then update the parameters and bitrate.
|
||||||
// // ignore the request.
|
update_radio_params(radio, &radio_details[index]);
|
||||||
// kiss_indicate_radiostate(radio);
|
update_bitrate(radio, index);
|
||||||
// return true;
|
kiss_indicate_radiostate(index);
|
||||||
//}
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void stopRadio(PhysicalLayer* radio, uint8_t index) {
|
void stopRadio(PhysicalLayer* radio, uint8_t index) {
|
||||||
@ -918,13 +918,11 @@ void serialCallback(uint8_t sbyte) {
|
|||||||
if (radio_details[interface].radio_online) {
|
if (radio_details[interface].radio_online) {
|
||||||
if (op_mode == MODE_HOST) status = selected_radio->setFrequency(freq_f);
|
if (op_mode == MODE_HOST) status = selected_radio->setFrequency(freq_f);
|
||||||
}
|
}
|
||||||
if (status == RADIOLIB_ERR_NONE) {
|
|
||||||
radio_details[interface].freq = freq_f;
|
radio_details[interface].freq = freq_f;
|
||||||
}
|
|
||||||
kiss_indicate_frequency(interface);
|
kiss_indicate_frequency(interface);
|
||||||
}
|
}
|
||||||
interface = 0;
|
|
||||||
}
|
}
|
||||||
|
interface = 0;
|
||||||
} else if (command == CMD_BANDWIDTH) {
|
} else if (command == CMD_BANDWIDTH) {
|
||||||
if (sbyte == FESC) {
|
if (sbyte == FESC) {
|
||||||
ESCAPE = true;
|
ESCAPE = true;
|
||||||
@ -946,18 +944,13 @@ void serialCallback(uint8_t sbyte) {
|
|||||||
kiss_indicate_bandwidth(interface);
|
kiss_indicate_bandwidth(interface);
|
||||||
} else {
|
} else {
|
||||||
float bw_f = bw / 1000.0;
|
float bw_f = bw / 1000.0;
|
||||||
if (radio_details[interface].radio_online) {
|
|
||||||
if (op_mode == MODE_HOST) set_bandwidth(selected_radio, interface, bw_f);
|
|
||||||
update_bitrate(selected_radio, interface);
|
|
||||||
kiss_indicate_phy_stats(interface);
|
|
||||||
} else {
|
|
||||||
radio_details[interface].bw = bw_f;
|
radio_details[interface].bw = bw_f;
|
||||||
}
|
|
||||||
sort_interfaces();
|
sort_interfaces();
|
||||||
kiss_indicate_bandwidth(interface);
|
kiss_indicate_bandwidth(interface);
|
||||||
}
|
}
|
||||||
interface = 0;
|
|
||||||
}
|
}
|
||||||
|
interface = 0;
|
||||||
} else if (command == CMD_TXPOWER) {
|
} else if (command == CMD_TXPOWER) {
|
||||||
selected_radio = interface_obj[interface];
|
selected_radio = interface_obj[interface];
|
||||||
|
|
||||||
@ -966,11 +959,8 @@ void serialCallback(uint8_t sbyte) {
|
|||||||
} else {
|
} else {
|
||||||
int8_t txp = (int8_t)sbyte;
|
int8_t txp = (int8_t)sbyte;
|
||||||
|
|
||||||
if (radio_details[interface].radio_online) {
|
|
||||||
if (op_mode == MODE_HOST) setTXPower(selected_radio, interface, txp);
|
if (op_mode == MODE_HOST) setTXPower(selected_radio, interface, txp);
|
||||||
} else {
|
//radio_details[interface].txp = txp; todo fix this path
|
||||||
radio_details[interface].txp = txp;
|
|
||||||
}
|
|
||||||
kiss_indicate_txpower(interface);
|
kiss_indicate_txpower(interface);
|
||||||
}
|
}
|
||||||
interface = 0;
|
interface = 0;
|
||||||
@ -984,13 +974,7 @@ void serialCallback(uint8_t sbyte) {
|
|||||||
if (sf < 5) sf = 5;
|
if (sf < 5) sf = 5;
|
||||||
if (sf > 12) sf = 12;
|
if (sf > 12) sf = 12;
|
||||||
|
|
||||||
if (radio_details[interface].radio_online) {
|
|
||||||
if (op_mode == MODE_HOST) set_spreading_factor(selected_radio, interface, sf);
|
|
||||||
update_bitrate(selected_radio, interface);
|
|
||||||
kiss_indicate_phy_stats(interface);
|
|
||||||
} else {
|
|
||||||
radio_details[interface].sf = sf;
|
radio_details[interface].sf = sf;
|
||||||
}
|
|
||||||
sort_interfaces();
|
sort_interfaces();
|
||||||
kiss_indicate_spreadingfactor(interface);
|
kiss_indicate_spreadingfactor(interface);
|
||||||
}
|
}
|
||||||
@ -1004,13 +988,7 @@ void serialCallback(uint8_t sbyte) {
|
|||||||
if (cr < 5) cr = 5;
|
if (cr < 5) cr = 5;
|
||||||
if (cr > 8) cr = 8;
|
if (cr > 8) cr = 8;
|
||||||
|
|
||||||
if (radio_details[interface].radio_online) {
|
|
||||||
if (op_mode == MODE_HOST) set_coding_rate(selected_radio, interface, cr);
|
|
||||||
update_bitrate(selected_radio, interface);
|
|
||||||
kiss_indicate_phy_stats(interface);
|
|
||||||
} else {
|
|
||||||
radio_details[interface].cr = cr;
|
radio_details[interface].cr = cr;
|
||||||
}
|
|
||||||
sort_interfaces();
|
sort_interfaces();
|
||||||
kiss_indicate_codingrate(interface);
|
kiss_indicate_codingrate(interface);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user