diff --git a/src/VehicleSetup/Bootloader.h b/src/VehicleSetup/Bootloader.h index ccd0355f6aaa9e116e1420eb190a6f8094ee1d14..dce4c85be2707c49d066ee924f7f67935173cf00 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 c6a01bf28efc7d5a2f54ed940535f264b6b21995..94c4b14cf79708100c87b8625f38566e4fa3ad90 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 d7f7c9d22d20d4fd6f7a4b08a8ea0d4d9730b362..b65b09eb03dcadbaff31d515ba3ebad25016c36f 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;