From da3191c3b346e091424146813c271ed1f9139a61 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sat, 21 Nov 2015 12:46:09 +0100 Subject: [PATCH] Add support for v4 boards --- src/VehicleSetup/Bootloader.h | 1 + src/VehicleSetup/FirmwareUpgradeController.cc | 17 +++++++++++++++++ src/VehicleSetup/FirmwareUpgradeController.h | 1 + 3 files changed, 19 insertions(+) diff --git a/src/VehicleSetup/Bootloader.h b/src/VehicleSetup/Bootloader.h index ccd0355f6..dce4c85be 100644 --- a/src/VehicleSetup/Bootloader.h +++ b/src/VehicleSetup/Bootloader.h @@ -76,6 +76,7 @@ public: // Supported bootloader board ids static const int boardIDPX4FMUV1 = 5; ///< PX4 V1 board static const int boardIDPX4FMUV2 = 9; ///< PX4 V2 board + static const int boardIDPX4FMUV4 = 11; ///< PX4 V4 board static const int boardIDPX4Flow = 6; ///< PX4 Flow board static const int boardIDAeroCore = 98; ///< Gumstix AeroCore board static const int boardID3DRRadio = 78; ///< 3DR Radio diff --git a/src/VehicleSetup/FirmwareUpgradeController.cc b/src/VehicleSetup/FirmwareUpgradeController.cc index c6a01bf28..94c4b14cf 100644 --- a/src/VehicleSetup/FirmwareUpgradeController.cc +++ b/src/VehicleSetup/FirmwareUpgradeController.cc @@ -187,6 +187,13 @@ void FirmwareUpgradeController::_initFirmwareHash() return; } + //////////////////////////////////// PX4FMUV4 firmwares ////////////////////////////////////////////////// + FirmwareToUrlElement_t rgPX4FMV4FirmwareArray[] = { + { AutoPilotStackPX4, StableFirmware, DefaultVehicleFirmware, "http://px4-travis.s3.amazonaws.com/Firmware/stable/px4fmu-v4_default.px4"}, + { AutoPilotStackPX4, BetaFirmware, DefaultVehicleFirmware, "http://px4-travis.s3.amazonaws.com/Firmware/beta/px4fmu-v4_default.px4"}, + { AutoPilotStackPX4, DeveloperFirmware, DefaultVehicleFirmware, "http://px4-travis.s3.amazonaws.com/Firmware/master/px4fmu-v4_default.px4"}, + }; + //////////////////////////////////// PX4FMUV2 firmwares ////////////////////////////////////////////////// FirmwareToUrlElement_t rgPX4FMV2FirmwareArray[] = { { AutoPilotStackPX4, StableFirmware, DefaultVehicleFirmware, "http://px4-travis.s3.amazonaws.com/Firmware/stable/px4fmu-v2_default.px4"}, @@ -273,6 +280,12 @@ void FirmwareUpgradeController::_initFirmwareHash() }; // populate hashes now + int size = sizeof(rgPX4FMV4FirmwareArray)/sizeof(rgPX4FMV4FirmwareArray[0]); + for (int i = 0; i < size; i++) { + const FirmwareToUrlElement_t& element = rgPX4FMV4FirmwareArray[i]; + _rgPX4FMUV4Firmware.insert(FirmwareIdentifier(element.stackType, element.firmwareType, element.vehicleType), element.url); + } + int size = sizeof(rgPX4FMV2FirmwareArray)/sizeof(rgPX4FMV2FirmwareArray[0]); for (int i = 0; i < size; i++) { const FirmwareToUrlElement_t& element = rgPX4FMV2FirmwareArray[i]; @@ -333,6 +346,10 @@ void FirmwareUpgradeController::_getFirmwareFile(FirmwareIdentifier firmwareId) case Bootloader::boardIDPX4FMUV2: prgFirmware = _rgPX4FMUV2Firmware; break; + + case Bootloader::boardIDPX4FMUV4: + prgFirmware = _rgPX4FMUV4Firmware; + break; case Bootloader::boardIDAeroCore: prgFirmware = _rgAeroCoreFirmware; diff --git a/src/VehicleSetup/FirmwareUpgradeController.h b/src/VehicleSetup/FirmwareUpgradeController.h index d7f7c9d22..b65b09eb0 100644 --- a/src/VehicleSetup/FirmwareUpgradeController.h +++ b/src/VehicleSetup/FirmwareUpgradeController.h @@ -177,6 +177,7 @@ private: QString _portDescription; // firmware hashes + QHash _rgPX4FMUV4Firmware; QHash _rgPX4FMUV2Firmware; QHash _rgAeroCoreFirmware; QHash _rgPX4FMUV1Firmware; -- 2.22.0