Skip to content

Commit

Permalink
Merge pull request #1744 from DonLakeFlyer/BootloaderFix
Browse files Browse the repository at this point in the history
Handle older bootloaders for Firmware Upgrade
  • Loading branch information
DonLakeFlyer committed Jul 27, 2015
2 parents f0ec6b6 + 201a2a0 commit b1b8548
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
15 changes: 8 additions & 7 deletions src/SerialPortIds.h
Expand Up @@ -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
4 changes: 1 addition & 3 deletions src/VehicleSetup/PX4FirmwareUpgradeThread.cc
Expand Up @@ -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;
Expand Down

0 comments on commit b1b8548

Please sign in to comment.