Commit f0c7cf1f authored by Lorenz Meier's avatar Lorenz Meier

Finished FMUv4 integration

parent 69587b45
...@@ -118,7 +118,8 @@ void FirmwareUpgradeController::_foundBoard(bool firstAttempt, const QSerialPort ...@@ -118,7 +118,8 @@ void FirmwareUpgradeController::_foundBoard(bool firstAttempt, const QSerialPort
_startFlashWhenBootloaderFound = false; _startFlashWhenBootloaderFound = false;
break; break;
case QGCSerialPortInfo::BoardTypePX4FMUV2: case QGCSerialPortInfo::BoardTypePX4FMUV2:
_foundBoardType = "Pixhawk"; case QGCSerialPortInfo::BoardTypePX4FMUV4:
_foundBoardType = "Pixhawk (any version)";
_startFlashWhenBootloaderFound = false; _startFlashWhenBootloaderFound = false;
break; break;
case QGCSerialPortInfo::BoardTypeAeroCore: case QGCSerialPortInfo::BoardTypeAeroCore:
......
...@@ -497,6 +497,7 @@ void LinkManager::_updateAutoConnectLinks(void) ...@@ -497,6 +497,7 @@ void LinkManager::_updateAutoConnectLinks(void)
switch (boardType) { switch (boardType) {
case QGCSerialPortInfo::BoardTypePX4FMUV1: case QGCSerialPortInfo::BoardTypePX4FMUV1:
case QGCSerialPortInfo::BoardTypePX4FMUV2: case QGCSerialPortInfo::BoardTypePX4FMUV2:
case QGCSerialPortInfo::BoardTypePX4FMUV4:
if (_autoconnectPixhawk) { if (_autoconnectPixhawk) {
pSerialConfig = new SerialConfiguration(QString("Pixhawk on %1").arg(portInfo.portName().trimmed())); pSerialConfig = new SerialConfiguration(QString("Pixhawk on %1").arg(portInfo.portName().trimmed()));
} }
......
...@@ -47,7 +47,10 @@ QGCSerialPortInfo::BoardType_t QGCSerialPortInfo::boardType(void) const ...@@ -47,7 +47,10 @@ QGCSerialPortInfo::BoardType_t QGCSerialPortInfo::boardType(void) const
switch (vendorIdentifier()) { switch (vendorIdentifier()) {
case px4VendorId: case px4VendorId:
if (productIdentifier() == pixhawkFMUV2ProductId || productIdentifier() == pixhawkFMUV2OldBootloaderProductId) { if (productIdentifier() == pixhawkFMUV4ProductId) {
qCDebug(QGCSerialPortInfoLog) << "Found PX4 FMU V4";
boardType = BoardTypePX4FMUV4;
} else if (productIdentifier() == pixhawkFMUV2ProductId || productIdentifier() == pixhawkFMUV2OldBootloaderProductId) {
qCDebug(QGCSerialPortInfoLog) << "Found PX4 FMU V2"; qCDebug(QGCSerialPortInfoLog) << "Found PX4 FMU V2";
boardType = BoardTypePX4FMUV2; boardType = BoardTypePX4FMUV2;
} else if (productIdentifier() == pixhawkFMUV1ProductId) { } else if (productIdentifier() == pixhawkFMUV1ProductId) {
...@@ -72,7 +75,10 @@ QGCSerialPortInfo::BoardType_t QGCSerialPortInfo::boardType(void) const ...@@ -72,7 +75,10 @@ QGCSerialPortInfo::BoardType_t QGCSerialPortInfo::boardType(void) const
if (boardType == BoardTypeUnknown) { if (boardType == BoardTypeUnknown) {
// Fall back to port name matching which could lead to incorrect board mapping. But in some cases the // 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. // vendor and product id do not come through correctly so this is used as a last chance detection method.
if (description() == "PX4 FMU v2.x" || description() == "PX4 BL FMU v2.x") { if (description() == "PX4 FMU v4.x" || description() == "PX4 BL FMU v4.x") {
qCDebug(QGCSerialPortInfoLog) << "Found PX4 FMU V4 (by name matching fallback)";
boardType = BoardTypePX4FMUV4;
} else if (description() == "PX4 FMU v2.x" || description() == "PX4 BL FMU v2.x") {
qCDebug(QGCSerialPortInfoLog) << "Found PX4 FMU V2 (by name matching fallback)"; qCDebug(QGCSerialPortInfoLog) << "Found PX4 FMU V2 (by name matching fallback)";
boardType = BoardTypePX4FMUV2; boardType = BoardTypePX4FMUV2;
} else if (description() == "PX4 FMU v1.x" || description() == "PX4 BL FMU v1.x") { } else if (description() == "PX4 FMU v1.x" || description() == "PX4 BL FMU v1.x") {
......
...@@ -42,6 +42,7 @@ public: ...@@ -42,6 +42,7 @@ public:
typedef enum { typedef enum {
BoardTypePX4FMUV1, BoardTypePX4FMUV1,
BoardTypePX4FMUV2, BoardTypePX4FMUV2,
BoardTypePX4FMUV4,
BoardTypePX4Flow, BoardTypePX4Flow,
BoardType3drRadio, BoardType3drRadio,
BoardTypeAeroCore, BoardTypeAeroCore,
...@@ -52,6 +53,7 @@ public: ...@@ -52,6 +53,7 @@ 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 pixhawkFMUV4ProductId = 18; ///< Product ID for Pixhawk V2 board
static const int pixhawkFMUV2ProductId = 17; ///< Product ID for Pixhawk V2 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 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 pixhawkFMUV1ProductId = 16; ///< Product ID for PX4 FMU V1 board
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment