diff --git a/src/VehicleSetup/Bootloader.h b/src/VehicleSetup/Bootloader.h index cdb2e77..b401a42 100644 --- a/src/VehicleSetup/Bootloader.h +++ b/src/VehicleSetup/Bootloader.h @@ -34,8 +34,9 @@ public: bool verify (const FirmwareImage* image); bool reboot (void); - static const int boardIDPX4Flow = 6; ///< PX4 Flow board, as from USB PID - static const int boardID3DRRadio = 78; ///< 3DR Radio. This is an arbitrary value unrelated to the PID + static const int boardIDPX4Flow = 6; ///< PX4 Flow board, as from USB PID + static const int boardIDSiKRadio1000 = 78; ///< Original radio based on SI1000 chip + static const int boardIDSiKRadio1060 = 80; ///< Newer radio based on SI1060 chip /// Simulated board id for V3 which is a V2 board which supports larger flash space /// IMPORTANT: Make sure this id does not conflict with any newly added real board ids diff --git a/src/VehicleSetup/FirmwareUpgradeController.cc b/src/VehicleSetup/FirmwareUpgradeController.cc index 50c4873..18472f2 100644 --- a/src/VehicleSetup/FirmwareUpgradeController.cc +++ b/src/VehicleSetup/FirmwareUpgradeController.cc @@ -247,7 +247,7 @@ void FirmwareUpgradeController::_foundBoard(bool firstAttempt, const QSerialPort // Radio always flashes latest firmware, so we can start right away without // any further user input. _startFlashWhenBootloaderFound = true; - _startFlashWhenBootloaderFoundFirmwareIdentity = FirmwareIdentifier(ThreeDRRadio, + _startFlashWhenBootloaderFoundFirmwareIdentity = FirmwareIdentifier(SiKRadio, StableFirmware, DefaultVehicleFirmware); } @@ -311,19 +311,10 @@ void FirmwareUpgradeController::_initFirmwareHash() #endif }; - /////////////////////////////// 3dr radio firmwares /////////////////////////////////////// - FirmwareToUrlElement_t rg3DRRadioFirmwareArray[] = { - { ThreeDRRadio, StableFirmware, DefaultVehicleFirmware, "http://px4-travis.s3.amazonaws.com/SiK/stable/radio~hm_trp.ihx"} - }; - // We build the maps for PX4 firmwares dynamically using the data below for (auto& element : rgPX4FLowFirmwareArray) { _rgPX4FLowFirmware.insert(FirmwareIdentifier(element.stackType, element.firmwareType, element.vehicleType), element.url); } - - for (auto& element : rg3DRRadioFirmwareArray) { - _rg3DRRadioFirmware.insert(FirmwareIdentifier(element.stackType, element.firmwareType, element.vehicleType), element.url); - } } /// @brief Called when the findBootloader process is unable to sync to the bootloader. Moves the state @@ -341,8 +332,17 @@ QHash* FirmwareUpgradeCo case Bootloader::boardIDPX4Flow: _rgFirmwareDynamic = _rgPX4FLowFirmware; break; - case Bootloader::boardID3DRRadio: - _rgFirmwareDynamic = _rg3DRRadioFirmware; + case Bootloader::boardIDSiKRadio1000: + { + FirmwareToUrlElement_t element = { SiKRadio, StableFirmware, DefaultVehicleFirmware, "http://px4-travis.s3.amazonaws.com/SiK/stable/radio~hm_trp.ihx" }; + _rgFirmwareDynamic.insert(FirmwareIdentifier(element.stackType, element.firmwareType, element.vehicleType), element.url); + } + break; + case Bootloader::boardIDSiKRadio1060: + { + FirmwareToUrlElement_t element = { SiKRadio, StableFirmware, DefaultVehicleFirmware, "https://px4-travis.s3.amazonaws.com/SiK/stable/radio~hb1060.ihx" }; + _rgFirmwareDynamic.insert(FirmwareIdentifier(element.stackType, element.firmwareType, element.vehicleType), element.url); + } break; default: if (px4_board_name_map.contains(boardId)) { diff --git a/src/VehicleSetup/FirmwareUpgradeController.h b/src/VehicleSetup/FirmwareUpgradeController.h index 3553441..90ebb50 100644 --- a/src/VehicleSetup/FirmwareUpgradeController.h +++ b/src/VehicleSetup/FirmwareUpgradeController.h @@ -37,7 +37,7 @@ public: AutoPilotStackAPM, PX4FlowPX4, PX4FlowAPM, - ThreeDRRadio, + SiKRadio, SingleFirmwareMode } AutoPilotStackType_t; @@ -78,7 +78,7 @@ public: // members AutoPilotStackType_t autopilotStackType; - FirmwareBuildType_t firmwareType; + FirmwareBuildType_t firmwareType; FirmwareVehicleType_t firmwareVehicleType; }; @@ -204,7 +204,7 @@ private: // Firmware hashes QHash _rgPX4FLowFirmware; - QHash _rg3DRRadioFirmware; + QHash _rgSiKRadioFirmware; // Hash map for ArduPilot ChibiOS lookup by board name QHash _rgAPMChibiosReplaceNamedBoardFirmware;