Browse Source

Support 1060 based SiK radios

QGC4.4
Don Gagne 3 years ago committed by Don Gagne
parent
commit
3f6a503aba
  1. 5
      src/VehicleSetup/Bootloader.h
  2. 24
      src/VehicleSetup/FirmwareUpgradeController.cc
  3. 6
      src/VehicleSetup/FirmwareUpgradeController.h

5
src/VehicleSetup/Bootloader.h

@ -34,8 +34,9 @@ public: @@ -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

24
src/VehicleSetup/FirmwareUpgradeController.cc

@ -247,7 +247,7 @@ void FirmwareUpgradeController::_foundBoard(bool firstAttempt, const QSerialPort @@ -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() @@ -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<FirmwareUpgradeController::FirmwareIdentifier, QString>* FirmwareUpgradeCo @@ -341,8 +332,17 @@ QHash<FirmwareUpgradeController::FirmwareIdentifier, QString>* 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)) {

6
src/VehicleSetup/FirmwareUpgradeController.h

@ -37,7 +37,7 @@ public: @@ -37,7 +37,7 @@ public:
AutoPilotStackAPM,
PX4FlowPX4,
PX4FlowAPM,
ThreeDRRadio,
SiKRadio,
SingleFirmwareMode
} AutoPilotStackType_t;
@ -78,7 +78,7 @@ public: @@ -78,7 +78,7 @@ public:
// members
AutoPilotStackType_t autopilotStackType;
FirmwareBuildType_t firmwareType;
FirmwareBuildType_t firmwareType;
FirmwareVehicleType_t firmwareVehicleType;
};
@ -204,7 +204,7 @@ private: @@ -204,7 +204,7 @@ private:
// Firmware hashes
QHash<FirmwareIdentifier, QString> _rgPX4FLowFirmware;
QHash<FirmwareIdentifier, QString> _rg3DRRadioFirmware;
QHash<FirmwareIdentifier, QString> _rgSiKRadioFirmware;
// Hash map for ArduPilot ChibiOS lookup by board name
QHash<FirmwareIdentifier, QString> _rgAPMChibiosReplaceNamedBoardFirmware;

Loading…
Cancel
Save