From 27d42a654f6452f1045ae159b1b57bfe65fb8736 Mon Sep 17 00:00:00 2001 From: Christophe Painchaud Date: Thu, 9 Feb 2023 10:31:05 +0100 Subject: [PATCH] don't try TX commands if no TX pin is set --- RFLink/RFLink.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/RFLink/RFLink.cpp b/RFLink/RFLink.cpp index 6c31d304..7451ddd7 100644 --- a/RFLink/RFLink.cpp +++ b/RFLink/RFLink.cpp @@ -394,14 +394,20 @@ namespace RFLink { // ------------------------------------------------------- // Handle Generic Commands / Translate protocol data into Nodo text commands // ------------------------------------------------------- - Radio::set_Radio_mode(Radio::Radio_TX); - - if (PluginTXCall(0, cmd)) - ValidCommand = 1; - else // Answer that an invalid command was received? - ValidCommand = 2; - - Radio::set_Radio_mode(Radio::Radio_RX); + if (Radio::pins::TX_DATA == NOT_A_PIN) { + display_Header(); + display_Name(PSTR("ERROR: TX_DATA PIN is not defined!")); + display_Footer(); + } + else { + Radio::set_Radio_mode(Radio::Radio_TX); + if (PluginTXCall(0, cmd)) + ValidCommand = 1; + else // Answer that an invalid command was received? + ValidCommand = 2; + + Radio::set_Radio_mode(Radio::Radio_RX); + } } } } // if > 7