Browse Source

Support 1060 based SiK radios

QGC4.4
Don Gagne 4 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:
bool verify (const FirmwareImage* image); bool verify (const FirmwareImage* image);
bool reboot (void); bool reboot (void);
static const int boardIDPX4Flow = 6; ///< PX4 Flow board, as from USB PID 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 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 /// 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 /// 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
// Radio always flashes latest firmware, so we can start right away without // Radio always flashes latest firmware, so we can start right away without
// any further user input. // any further user input.
_startFlashWhenBootloaderFound = true; _startFlashWhenBootloaderFound = true;
_startFlashWhenBootloaderFoundFirmwareIdentity = FirmwareIdentifier(ThreeDRRadio, _startFlashWhenBootloaderFoundFirmwareIdentity = FirmwareIdentifier(SiKRadio,
StableFirmware, StableFirmware,
DefaultVehicleFirmware); DefaultVehicleFirmware);
} }
@ -311,19 +311,10 @@ void FirmwareUpgradeController::_initFirmwareHash()
#endif #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 // We build the maps for PX4 firmwares dynamically using the data below
for (auto& element : rgPX4FLowFirmwareArray) { for (auto& element : rgPX4FLowFirmwareArray) {
_rgPX4FLowFirmware.insert(FirmwareIdentifier(element.stackType, element.firmwareType, element.vehicleType), element.url); _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 /// @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
case Bootloader::boardIDPX4Flow: case Bootloader::boardIDPX4Flow:
_rgFirmwareDynamic = _rgPX4FLowFirmware; _rgFirmwareDynamic = _rgPX4FLowFirmware;
break; break;
case Bootloader::boardID3DRRadio: case Bootloader::boardIDSiKRadio1000:
_rgFirmwareDynamic = _rg3DRRadioFirmware; {
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; break;
default: default:
if (px4_board_name_map.contains(boardId)) { if (px4_board_name_map.contains(boardId)) {

6
src/VehicleSetup/FirmwareUpgradeController.h

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

Loading…
Cancel
Save