From e14347bf470e09cdaf09de154b5b06e0ccc81285 Mon Sep 17 00:00:00 2001 From: Dominic Clifton Date: Sat, 13 Sep 2014 13:08:24 +0100 Subject: [PATCH] Disable softserial port 2 on Naze and Olimexino targets when SONAR is enabled without RX_PARALLEL_PWM because they use the same pins. --- src/main/io/serial.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/io/serial.c b/src/main/io/serial.c index 5943d72114..e9f012f280 100644 --- a/src/main/io/serial.c +++ b/src/main/io/serial.c @@ -251,6 +251,13 @@ serialPortSearchResult_t *findNextSerialPort(serialPortFunction_e function, cons )) { continue; } + +#if (defined(NAZE) || defined(OLIMEXINO)) && defined(SONAR) + if (!feature(FEATURE_RX_PARALLEL_PWM) && (serialPortConstraint->identifier == SERIAL_PORT_SOFTSERIAL2)) { + continue; + } +#endif + #endif if (functionConstraint->requiredSerialPortFeatures != SPF_NONE) {