Skip to content

Commit

Permalink
don't try TX commands if no TX pin is set
Browse files Browse the repository at this point in the history
  • Loading branch information
cpainchaud committed Feb 13, 2023
1 parent 8019e83 commit 27d42a6
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions RFLink/RFLink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 27d42a6

Please # to comment.