From d72e75ed16898d7f961a145305d8f7a5b8cc27cb Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Mon, 12 Feb 2024 16:02:31 +1100 Subject: [PATCH] AP_RCProtocol: correct compilation when crossfire not compiled in --- libraries/AP_RCProtocol/AP_RCProtocol_GHST.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libraries/AP_RCProtocol/AP_RCProtocol_GHST.cpp b/libraries/AP_RCProtocol/AP_RCProtocol_GHST.cpp index a51c9dd795c88..b0b678d8a5f8f 100644 --- a/libraries/AP_RCProtocol/AP_RCProtocol_GHST.cpp +++ b/libraries/AP_RCProtocol/AP_RCProtocol_GHST.cpp @@ -435,10 +435,15 @@ void AP_RCProtocol_GHST::process_handshake(uint32_t baudrate) || baudrate != CRSF_BAUDRATE || baudrate == GHST_BAUDRATE || uart->get_baud_rate() == GHST_BAUDRATE - || !protocol_enabled(AP_RCProtocol::GHST) - || protocol_enabled(AP_RCProtocol::CRSF)) { + || !protocol_enabled(AP_RCProtocol::GHST)) { return; } +#if AP_RCPROTOCOL_CRSF_ENABLED + if (protocol_enabled(AP_RCProtocol::CRSF)) { + // don't fight CRSF + return; + } +#endif uart->begin(GHST_BAUDRATE); }