AP_ADSB: use have_serial when detecting

avoid find_serial() as it changes port options
This commit is contained in:
Andrew Tridgell 2021-12-20 15:35:42 +11:00
parent 47590a55ff
commit 0da0f6dd37
2 changed files with 2 additions and 2 deletions

View File

@ -45,7 +45,7 @@
// detect if any port is configured as Sagetech // detect if any port is configured as Sagetech
bool AP_ADSB_Sagetech::detect() bool AP_ADSB_Sagetech::detect()
{ {
return (AP::serialmanager().find_serial(AP_SerialManager::SerialProtocol_ADSB, 0) != nullptr); return AP::serialmanager().have_serial(AP_SerialManager::SerialProtocol_ADSB, 0);
} }
// Init, called once after class is constructed // Init, called once after class is constructed

View File

@ -45,7 +45,7 @@ extern const AP_HAL::HAL &hal;
// detect if any port is configured as uAvionix_UCP // detect if any port is configured as uAvionix_UCP
bool AP_ADSB_uAvionix_UCP::detect() bool AP_ADSB_uAvionix_UCP::detect()
{ {
return (AP::serialmanager().find_serial(AP_SerialManager::SerialProtocol_ADSB, 0) != nullptr); return AP::serialmanager().have_serial(AP_SerialManager::SerialProtocol_ADSB, 0);
} }