From 366ff24941f4d18288d33230246fa4f23faa5822 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 20 Dec 2021 15:35:43 +1100 Subject: [PATCH] AP_RangeFinder: use have_serial when detecting avoid find_serial() as it changes port options --- libraries/AP_RangeFinder/AP_RangeFinder_Backend_Serial.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_RangeFinder/AP_RangeFinder_Backend_Serial.cpp b/libraries/AP_RangeFinder/AP_RangeFinder_Backend_Serial.cpp index fc618c6d32..cfacdb6ba1 100644 --- a/libraries/AP_RangeFinder/AP_RangeFinder_Backend_Serial.cpp +++ b/libraries/AP_RangeFinder/AP_RangeFinder_Backend_Serial.cpp @@ -53,7 +53,7 @@ uint32_t AP_RangeFinder_Backend_Serial::initial_baudrate(const uint8_t serial_in */ bool AP_RangeFinder_Backend_Serial::detect(uint8_t serial_instance) { - return AP::serialmanager().find_serial(AP_SerialManager::SerialProtocol_Rangefinder, serial_instance) != nullptr; + return AP::serialmanager().have_serial(AP_SerialManager::SerialProtocol_Rangefinder, serial_instance); }