From e015173530f1ff9df92ef0409adb95be8d8177be Mon Sep 17 00:00:00 2001 From: Ian Taylor Date: Thu, 16 Nov 2023 09:56:11 -0700 Subject: [PATCH] [RF] Fix crash on transmit with CC1101/ESP32 (#1809) * Disable active receiver before setting transmit power or frequency. * Fixed formatting. --- main/ZgatewayRF.ino | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main/ZgatewayRF.ino b/main/ZgatewayRF.ino index f5eeb87..c7c3dd4 100644 --- a/main/ZgatewayRF.ino +++ b/main/ZgatewayRF.ino @@ -262,13 +262,14 @@ void MQTTtoRF(char* topicOri, JsonObject& RFdata) { // json object decoding Log.notice(F("RF Pulse Lgth: %d" CR), valuePLSL); Log.notice(F("Bits nb: %d" CR), valueBITS); # ifdef ZradioCC1101 // set Receive off and Transmitt on + disableActiveReceiver(); + int txPower = RFdata["txpower"] | RF_CC1101_TXPOWER; ELECHOUSE_cc1101.setPA((int)txPower); Log.notice(F("CC1101 TX Power: %d" CR), txPower); float trMhz = RFdata["mhz"] | CC1101_FREQUENCY; if (validFrequency((int)trMhz)) { - disableActiveReceiver(); ELECHOUSE_cc1101.SetTx(trMhz); Log.notice(F("Transmit mhz: %F" CR), trMhz); }