From 08ca70834729ed0701e4aa3ec3bc26ae86d7867e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 21 Dec 2021 19:12:58 +1100 Subject: [PATCH] AP_SerialManager: fixed AP_Periph GPS the disable of RX/TX pins broke AP_Periph on boards that don't enable the GCS, as they don't have the SERIALn parameters, so we disable the UART pins of the GPS --- libraries/AP_SerialManager/AP_SerialManager.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libraries/AP_SerialManager/AP_SerialManager.cpp b/libraries/AP_SerialManager/AP_SerialManager.cpp index 87a5482ee6..a3f3db96b3 100644 --- a/libraries/AP_SerialManager/AP_SerialManager.cpp +++ b/libraries/AP_SerialManager/AP_SerialManager.cpp @@ -450,9 +450,14 @@ void AP_SerialManager::init() set_options(i); switch (state[i].protocol) { case SerialProtocol_None: +#if HAL_GCS_ENABLED // disable RX and TX pins in case they are shared - // with another peripheral (eg. RCIN pin) + // with another peripheral (eg. RCIN pin). We + // don't do this if GCS is not enabled as in that + // case we don't have serialmanager parameters and + // this would prevent AP_Periph from using a GPS uart->disable_rxtx(); +#endif break; case SerialProtocol_Console: case SerialProtocol_MAVLink: