From 8b69f09ddff02acd9119ef4f3df7c582b21f6f95 Mon Sep 17 00:00:00 2001 From: Scott Powell Date: Wed, 5 Feb 2025 22:04:25 +1100 Subject: [PATCH 1/2] * companion radio: CMD_SET_RADIO_PARAMS fix --- examples/companion_radio/main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/companion_radio/main.cpp b/examples/companion_radio/main.cpp index 9444e4f4..c6a16f9d 100644 --- a/examples/companion_radio/main.cpp +++ b/examples/companion_radio/main.cpp @@ -619,8 +619,8 @@ public: memcpy(&freq, &cmd_frame[i], 4); i += 4; uint32_t bw; memcpy(&bw, &cmd_frame[i], 4); i += 4; - uint8_t sf = out_frame[i++]; - uint8_t cr = out_frame[i++]; + uint8_t sf = cmd_frame[i++]; + uint8_t cr = cmd_frame[i++]; if (freq >= 300000 && freq <= 2500000 && sf >= 7 && sf <= 12 && cr >= 5 && cr <= 8 && bw >= 7000 && bw <= 500000) { _prefs.sf = sf; @@ -630,6 +630,7 @@ public: savePrefs(); writeOKFrame(); // reboot now required! } else { + MESH_DEBUG_PRINTLN("Error: CMD_SET_RADIO_PARAMS: f=%d, bw=%d, sf=%d, cr=%d", freq, bw, (uint32_t)sf, (uint32_t)cr); writeErrFrame(); } } else if (cmd_frame[0] == CMD_SET_RADIO_TX_POWER) { From cc0ba10cf144b7d5b6f7fed8ababb693ff1ab1dd Mon Sep 17 00:00:00 2001 From: Scott Powell Date: Thu, 6 Feb 2025 08:44:06 +1100 Subject: [PATCH 2/2] * RAK battery ADC multiplier tweak --- src/helpers/nrf52/RAK4631Board.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/nrf52/RAK4631Board.h b/src/helpers/nrf52/RAK4631Board.h index bd7aca29..61188258 100644 --- a/src/helpers/nrf52/RAK4631Board.h +++ b/src/helpers/nrf52/RAK4631Board.h @@ -18,7 +18,7 @@ // built-ins #define PIN_VBAT_READ 5 -#define ADC_MULTIPLIER (3 * 1.73 * 1000) +#define ADC_MULTIPLIER (3 * 1.73 * 1.187 * 1000) class RAK4631Board : public mesh::MainBoard { protected: