From 6e3bf198c63404770141d63a404807f3cb1957a0 Mon Sep 17 00:00:00 2001 From: "Denis Arnst (Sapd)" Date: Tue, 11 Aug 2015 22:21:44 +0200 Subject: [PATCH] Added port name matching fallback for detecting the Pixhawk FMUv2 on USB --- src/VehicleSetup/PX4FirmwareUpgradeThread.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/VehicleSetup/PX4FirmwareUpgradeThread.cc b/src/VehicleSetup/PX4FirmwareUpgradeThread.cc index b42d9a3..0174deb 100644 --- a/src/VehicleSetup/PX4FirmwareUpgradeThread.cc +++ b/src/VehicleSetup/PX4FirmwareUpgradeThread.cc @@ -172,6 +172,15 @@ bool PX4FirmwareUpgradeThreadWorker::_findBoardFromPorts(QSerialPortInfo& portIn } break; } + if (!found) { + // Fall back to port name matching which could lead to incorrect board mapping. But in some cases the + // vendor and product id do not come through correctly so this is used as a last chance detection method. + if (info.description() == "PX4 FMU v2.x") { + qCDebug(FirmwareUpgradeLog) << "Found PX4 FMU V2 (by name matching fallback)"; + type = FoundBoardPX4FMUV2; + found = true; + } + } } if (found) {