From 201a2a0b24dbcfbfa13a7ed2db3a759409c888b8 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Mon, 27 Jul 2015 10:48:35 -0700 Subject: [PATCH] Handle older bootloaders --- src/SerialPortIds.h | 15 ++++++++------- src/VehicleSetup/PX4FirmwareUpgradeThread.cc | 4 +--- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/SerialPortIds.h b/src/SerialPortIds.h index a9613781b..f08ed5d9e 100644 --- a/src/SerialPortIds.h +++ b/src/SerialPortIds.h @@ -28,17 +28,18 @@ class SerialPortIds { public: - static const int px4VendorId = 9900; ///< Vendor ID for Pixhawk board (V2 and V1) and PX4 Flow + static const int px4VendorId = 9900; ///< Vendor ID for Pixhawk board (V2 and V1) and PX4 Flow - static const int pixhawkFMUV2ProductId = 17; ///< Product ID for Pixhawk V2 board - static const int pixhawkFMUV1ProductId = 16; ///< Product ID for PX4 FMU V1 board + static const int pixhawkFMUV2ProductId = 17; ///< Product ID for Pixhawk V2 board + static const int pixhawkFMUV2OldBootloaderProductId = 22; ///< Product ID for Bootloader on older Pixhawk V2 boards + static const int pixhawkFMUV1ProductId = 16; ///< Product ID for PX4 FMU V1 board - static const int AeroCoreProductId = 4097; ///< Product ID for the AeroCore board + static const int AeroCoreProductId = 4097; ///< Product ID for the AeroCore board - static const int px4FlowProductId = 21; ///< Product ID for PX4 Flow board + static const int px4FlowProductId = 21; ///< Product ID for PX4 Flow board - static const int threeDRRadioVendorId = 1027; ///< Vendor ID for 3DR Radio - static const int threeDRRadioProductId = 24597; ///< Product ID for 3DR Radio + static const int threeDRRadioVendorId = 1027; ///< Vendor ID for 3DR Radio + static const int threeDRRadioProductId = 24597; ///< Product ID for 3DR Radio }; #endif diff --git a/src/VehicleSetup/PX4FirmwareUpgradeThread.cc b/src/VehicleSetup/PX4FirmwareUpgradeThread.cc index 8663f5fc9..b42d9a33c 100644 --- a/src/VehicleSetup/PX4FirmwareUpgradeThread.cc +++ b/src/VehicleSetup/PX4FirmwareUpgradeThread.cc @@ -136,19 +136,17 @@ bool PX4FirmwareUpgradeThreadWorker::_findBoardFromPorts(QSerialPortInfo& portIn bool found = false; foreach (QSerialPortInfo info, QSerialPortInfo::availablePorts()) { -#if 0 qCDebug(FirmwareUpgradeLog) << "Serial Port --------------"; qCDebug(FirmwareUpgradeLog) << "\tport name:" << info.portName(); qCDebug(FirmwareUpgradeLog) << "\tdescription:" << info.description(); qCDebug(FirmwareUpgradeLog) << "\tsystem location:" << info.systemLocation(); qCDebug(FirmwareUpgradeLog) << "\tvendor ID:" << info.vendorIdentifier(); qCDebug(FirmwareUpgradeLog) << "\tproduct ID:" << info.productIdentifier(); -#endif if (!info.portName().isEmpty()) { switch (info.vendorIdentifier()) { case SerialPortIds::px4VendorId: - if (info.productIdentifier() == SerialPortIds::pixhawkFMUV2ProductId) { + if (info.productIdentifier() == SerialPortIds::pixhawkFMUV2ProductId || info.productIdentifier() == SerialPortIds::pixhawkFMUV2OldBootloaderProductId) { qCDebug(FirmwareUpgradeLog) << "Found PX4 FMU V2"; type = FoundBoardPX4FMUV2; found = true; -- 2.22.0