diff --git a/flight/targets/boards/sparky2/board-info.mk b/flight/targets/boards/sparky2/board-info.mk index 413f5d739..967130e6d 100644 --- a/flight/targets/boards/sparky2/board-info.mk +++ b/flight/targets/boards/sparky2/board-info.mk @@ -1,4 +1,4 @@ -BOARD_TYPE := 0x0B +BOARD_TYPE := 0x0b BOARD_REVISION := 0x01 BOOTLOADER_VERSION := 0x06 HW_TYPE := 0x00 diff --git a/ground/gcs/src/plugins/config/configoplinkwidget.cpp b/ground/gcs/src/plugins/config/configoplinkwidget.cpp index 9ccd73f6d..536a76f5a 100644 --- a/ground/gcs/src/plugins/config/configoplinkwidget.cpp +++ b/ground/gcs/src/plugins/config/configoplinkwidget.cpp @@ -208,7 +208,7 @@ void ConfigOPLinkWidget::updateSettings(UAVObject *object) UAVObjectField *board_type_field = oplinkStatusObj->getField("BoardType"); switch (board_type_field->getValue().toInt()) { case 0x09: // Revolution, DiscoveryF4Bare, RevoNano, RevoProto - case 0x0B: // Sparky2 + case 0x0b: // Sparky2 m_oplink->MainPort->setVisible(false); m_oplink->MainPortLabel->setVisible(false); m_oplink->FlexiPort->setVisible(false); @@ -232,7 +232,7 @@ void ConfigOPLinkWidget::updateSettings(UAVObject *object) connect(m_oplink->MainPort, SIGNAL(currentIndexChanged(int)), this, SLOT(updatePPMOptions())); connect(m_oplink->FlexiPort, SIGNAL(currentIndexChanged(int)), this, SLOT(updatePPMOptions())); break; - case 0x0A: // OPLink? (No. This is wrong. 0x0A is gpsplatinum.) + case 0x0a: // OPLink? (No. This is wrong. 0x0A is gpsplatinum.) m_oplink->MainPort->setVisible(true); m_oplink->MainPortLabel->setVisible(true); m_oplink->FlexiPort->setVisible(true); diff --git a/ground/gcs/src/plugins/config/configstabilizationwidget.cpp b/ground/gcs/src/plugins/config/configstabilizationwidget.cpp index 388f2ed85..07e84caaa 100644 --- a/ground/gcs/src/plugins/config/configstabilizationwidget.cpp +++ b/ground/gcs/src/plugins/config/configstabilizationwidget.cpp @@ -657,7 +657,7 @@ void ConfigStabilizationWidget::onBoardConnected() Q_ASSERT(utilMngr); boardModel = utilMngr->getBoardModel(); // If Revolution/Sparky2 board enable Althold tab, otherwise disable it - ui->AltitudeHold->setEnabled(((boardModel & 0xff00) == 0x0900) || ((boardModel & 0xff00) == 0x0B00)); + ui->AltitudeHold->setEnabled(((boardModel & 0xff00) == 0x0900) || ((boardModel & 0xff00) == 0x0b00)); } void ConfigStabilizationWidget::stabBankChanged(int index) @@ -689,7 +689,7 @@ void ConfigStabilizationWidget::stabBankChanged(int index) bool ConfigStabilizationWidget::shouldObjectBeSaved(UAVObject *object) { // AltitudeHoldSettings should only be saved for Revolution/Sparky2 board to avoid error. - if (((boardModel & 0xff00) != 0x0900) && ((boardModel & 0xff00) != 0x0B00)) { + if (((boardModel & 0xff00) != 0x0900) && ((boardModel & 0xff00) != 0x0b00)) { return dynamic_cast(object) == 0; } else { return true; diff --git a/ground/gcs/src/plugins/flightlog/flightlogmanager.cpp b/ground/gcs/src/plugins/flightlog/flightlogmanager.cpp index c43aa8fc3..5b5047a82 100644 --- a/ground/gcs/src/plugins/flightlog/flightlogmanager.cpp +++ b/ground/gcs/src/plugins/flightlog/flightlogmanager.cpp @@ -603,7 +603,7 @@ void FlightLogManager::connectionStatusChanged() if (m_telemtryManager->isConnected()) { ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); UAVObjectUtilManager *utilMngr = pm->getObject(); - setBoardConnected(utilMngr->getBoardModel() == 0x0903); + setBoardConnected(utilMngr->getBoardModel() == 0x0903 || utilMngr->getBoardModel() == 0x0904 || utilMngr->getBoardModel() == 0x0905 || utilMngr->getBoardModel() == 0x0b01); } else { setBoardConnected(false); } diff --git a/ground/gcs/src/plugins/uavobjectutil/devicedescriptorstruct.h b/ground/gcs/src/plugins/uavobjectutil/devicedescriptorstruct.h index 72929df4f..1c9b74d11 100644 --- a/ground/gcs/src/plugins/uavobjectutil/devicedescriptorstruct.h +++ b/ground/gcs/src/plugins/uavobjectutil/devicedescriptorstruct.h @@ -42,12 +42,12 @@ public: break; case 0x0901: - // Revolution + // old unreleased Revolution prototype return QString("Revolution"); break; case 0x0903: - // Revo Mini + // Revo also known as Revo Mini return QString("Revolution"); break; diff --git a/ground/gcs/src/plugins/uploader/devicewidget.cpp b/ground/gcs/src/plugins/uploader/devicewidget.cpp index ae45d7c7d..e64749ddc 100644 --- a/ground/gcs/src/plugins/uploader/devicewidget.cpp +++ b/ground/gcs/src/plugins/uploader/devicewidget.cpp @@ -101,15 +101,19 @@ void DeviceWidget::populate() devicePic.load(":/uploader/images/gcs-board-cc3d.png"); break; case 0x0903: + // Revo devicePic.load(":/uploader/images/gcs-board-revo.png"); break; case 0x0904: + // DiscoveryF4Bare devicePic.load(":/uploader/images/gcs-board-revo.png"); break; case 0x0905: + // Nano devicePic.load(":/uploader/images/gcs-board-nano.png"); break; case 0x0b01: + // Sparky2 devicePic.load(":/uploader/images/gcs-board-sparky2.png"); break; default: @@ -368,9 +372,9 @@ void DeviceWidget::uploadFirmware() // - Check whether board type matches firmware: int board = m_dfu->devices[deviceID].ID; int firmwareBoard = ((desc.at(12) & 0xff) << 8) + (desc.at(13) & 0xff); - if ((board == 0x401 && firmwareBoard == 0x402) || - (board == 0x901 && firmwareBoard == 0x902) || // L3GD20 revo supports Revolution firmware - (board == 0x902 && firmwareBoard == 0x903)) { // RevoMini1 supporetd by RevoMini2 firmware + if ((board == 0x0401 && firmwareBoard == 0x0402) || + (board == 0x0901 && firmwareBoard == 0x0902) || // L3GD20 revo supports Revolution firmware + (board == 0x0902 && firmwareBoard == 0x0903)) { // RevoMini1 supporetd by RevoMini2 firmware // These firmwares are designed to be backwards compatible } else if (firmwareBoard != board) { status("Error: firmware does not match board", STATUSICON_FAIL); diff --git a/ground/gcs/src/plugins/uploader/runningdevicewidget.cpp b/ground/gcs/src/plugins/uploader/runningdevicewidget.cpp index 330c4b55a..c6a903b4d 100644 --- a/ground/gcs/src/plugins/uploader/runningdevicewidget.cpp +++ b/ground/gcs/src/plugins/uploader/runningdevicewidget.cpp @@ -87,12 +87,18 @@ void RunningDeviceWidget::populate() devicePic.load(":/uploader/images/gcs-board-cc3d.png"); break; case 0x0903: + // Revo + // fall through to DF4B + case 0x0904: + // DiscoveryF4Bare devicePic.load(":/uploader/images/gcs-board-revo.png"); break; case 0x0905: + // Nano devicePic.load(":/uploader/images/gcs-board-nano.png"); break; case 0x0b01: + // Sparky2 devicePic.load(":/uploader/images/gcs-board-sparky2.png"); break; default: diff --git a/ground/gcs/src/plugins/uploader/uploadergadgetwidget.cpp b/ground/gcs/src/plugins/uploader/uploadergadgetwidget.cpp index 1ac53b3e5..ddd8d923e 100644 --- a/ground/gcs/src/plugins/uploader/uploadergadgetwidget.cpp +++ b/ground/gcs/src/plugins/uploader/uploadergadgetwidget.cpp @@ -751,29 +751,29 @@ bool UploaderGadgetWidget::autoUpdate(bool erase) QString filename; emit progressUpdate(LOADING_FW, QVariant()); switch (m_dfu->devices[0].ID) { - case 0x301: + case 0x0301: filename = "fw_oplinkmini"; break; - case 0x401: - case 0x402: + case 0x0401: + case 0x0402: filename = "fw_coptercontrol"; break; - case 0x501: + case 0x0501: filename = "fw_osd"; break; - case 0x902: + case 0x0902: filename = "fw_revoproto"; break; - case 0x903: + case 0x0903: filename = "fw_revolution"; break; - case 0x904: + case 0x0904: filename = "fw_discoveryf4bare"; break; - case 0x905: + case 0x0905: filename = "fw_revonano"; break; - case 0xb01: + case 0x0b01: filename = "fw_sparky2"; break; default: @@ -1023,7 +1023,8 @@ void UploaderGadgetWidget::startAutoUpdateErase() UAVObjectUtilManager *utilMngr = pm->getObject(); int id = utilMngr->getBoardModel(); - if (id == 0x905) { + // reset if Nano + if (id == 0x0905) { systemReset(); } } diff --git a/ground/gcs/src/plugins/usagetracker/usagetrackerplugin.cpp b/ground/gcs/src/plugins/usagetracker/usagetrackerplugin.cpp index 78f1ce979..644f36e48 100644 --- a/ground/gcs/src/plugins/usagetracker/usagetrackerplugin.cpp +++ b/ground/gcs/src/plugins/usagetracker/usagetrackerplugin.cpp @@ -199,6 +199,7 @@ void UsageTrackerPlugin::collectUsageParameters(QMap ¶mete parameters["conf_rport"] = getUAVFieldValue(objManager, "HwSettings", "SPK2_RcvrPort"); parameters["conf_mport"] = getUAVFieldValue(objManager, "HwSettings", "SPK2_MainPort"); parameters["conf_fport"] = getUAVFieldValue(objManager, "HwSettings", "SPK2_FlexiPort"); + parameters["conf_iport"] = getUAVFieldValue(objManager, "HwSettings", "SPK2_I2CPort"); parameters["conf_fusion"] = getUAVFieldValue(objManager, "RevoSettings", "FusionAlgorithm"); }