diff --git a/flight/targets/boards/sparky2/firmware/pios_board.c b/flight/targets/boards/sparky2/firmware/pios_board.c index af798ca67..d5b0d99ef 100644 --- a/flight/targets/boards/sparky2/firmware/pios_board.c +++ b/flight/targets/boards/sparky2/firmware/pios_board.c @@ -1,5 +1,5 @@ /** - ****************************************************************************** + **************************************************************************************** * @file pios_board.c * @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2015-2016. * The OpenPilot Team, http://www.openpilot.org Copyright (C) 2011. @@ -8,8 +8,8 @@ * @{ * @addtogroup OpenPilotCore OpenPilot Core * @{ - * @brief Defines board specific static initializers for hardware for the revomini board. - *****************************************************************************/ + * @brief Defines board specific static initializers for hardware for the Sparky2 board. + ***************************************************************************************/ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -484,7 +484,7 @@ void PIOS_Board_Init(void) PIOS_Board_configure_com(&pios_usart_flexi_cfg, PIOS_COM_GPS_RX_BUF_LEN, PIOS_COM_GPS_TX_BUF_LEN, &pios_usart_com_driver, &pios_com_gps_id); break; case HWSETTINGS_RM_FLEXIPORT_DSM: - // TODO: Define the various Channelgroup for Revo dsm inputs and handle here + // TODO: Define the various Channelgroup for Sparky2 dsm inputs and handle here PIOS_Board_configure_dsm(&pios_usart_dsm_flexi_cfg, &pios_dsm_flexi_cfg, &pios_usart_com_driver, MANUALCONTROLSETTINGS_CHANNELGROUPS_DSMFLEXIPORT, &hwsettings_DSMxBind); break; @@ -727,7 +727,7 @@ void PIOS_Board_Init(void) // Force binding to zero on the main port hwsettings_DSMxBind = 0; - // TODO: Define the various Channelgroup for Revo dsm inputs and handle here + // TODO: Define the various Channelgroup for Sparky2 dsm inputs and handle here PIOS_Board_configure_dsm(&pios_usart_dsm_main_cfg, &pios_dsm_main_cfg, &pios_usart_com_driver, MANUALCONTROLSETTINGS_CHANNELGROUPS_DSMMAINPORT, &hwsettings_DSMxBind); break; @@ -868,18 +868,6 @@ void PIOS_Board_Init(void) #endif /* Configure the receiver port*/ - // Revo Flex-IO Port Functions - // 1: GND - // 2: VCC_UNREG - // 3: PB12 = SPI2 NSS, CAN2 RX - // 4: PB13 = SPI2 SCK, CAN2 TX, USART3 CTS - // 5: PB14 = SPI2 MISO, TIM12 CH1, USART3 RTS - // 6: PB15 = SPI2 MOSI, TIM12 CH2 - // 7: PC6 = TIM8 CH1, USART6 TX - // 8: PC7 = TIM8 CH2, USART6 RX - // 9: PC8 = TIM8 CH3 - // 10: PC9 = TIM8 CH4 - // // Sparky2 receiver input on PC7 TIM8 CH2 // that appears to include PPM, DSM, DSM-HSUM, SBUS uint8_t hwsettings_rcvrport; @@ -913,7 +901,7 @@ void PIOS_Board_Init(void) #endif break; case HWSETTINGS_SPK2_RCVRPORT_DSM: - // TODO: Define the various Channelgroup for Revo dsm inputs and handle here + // TODO: Define the various Channelgroup for Sparky2 dsm inputs and handle here PIOS_Board_configure_dsm(&pios_usart_dsm_rcvr_cfg, &pios_dsm_rcvr_cfg, &pios_usart_com_driver, MANUALCONTROLSETTINGS_CHANNELGROUPS_DSMRCVRPORT, &hwsettings_DSMxBind); break; diff --git a/ground/gcs/src/plugins/config/configoplinkwidget.cpp b/ground/gcs/src/plugins/config/configoplinkwidget.cpp index 8fea81c2f..45bc5a6de 100644 --- a/ground/gcs/src/plugins/config/configoplinkwidget.cpp +++ b/ground/gcs/src/plugins/config/configoplinkwidget.cpp @@ -207,7 +207,8 @@ void ConfigOPLinkWidget::updateSettings(UAVObject *object) // Enable components based on the board type connected. UAVObjectField *board_type_field = oplinkStatusObj->getField("BoardType"); switch (board_type_field->getValue().toInt()) { - case 0x09: // Revolution + case 0x09: // Revolution, DiscoveryF4Bare, RevoNano, RevoProto + case 0x0B: // Sparky2 m_oplink->MainPort->setVisible(false); m_oplink->MainPortLabel->setVisible(false); m_oplink->FlexiPort->setVisible(false); @@ -231,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? + case 0x0A: // OPLink? (No. 0x0A is gpsplatinum. This is wrong.) m_oplink->MainPort->setVisible(true); m_oplink->MainPortLabel->setVisible(true); m_oplink->FlexiPort->setVisible(true); diff --git a/ground/gcs/src/plugins/config/configsparky2hwwidget.cpp b/ground/gcs/src/plugins/config/configsparky2hwwidget.cpp index b1da9465a..212b878e8 100644 --- a/ground/gcs/src/plugins/config/configsparky2hwwidget.cpp +++ b/ground/gcs/src/plugins/config/configsparky2hwwidget.cpp @@ -27,15 +27,18 @@ */ #include "configsparky2hwwidget.h" -#include +#include "ui_configsparky2hwwidget.h" + #include #include + #include "hwsettings.h" + +#include #include #include #include - ConfigSparky2HWWidget::ConfigSparky2HWWidget(QWidget *parent) : ConfigTaskWidget(parent), m_refreshing(true) { m_ui = new Ui_Sparky2HWWidget(); @@ -67,9 +70,6 @@ ConfigSparky2HWWidget::ConfigSparky2HWWidget(QWidget *parent) : ConfigTaskWidget addWidgetBinding("HwSettings", "GPSSpeed", m_ui->cbMainGPSSpeed); addWidgetBinding("HwSettings", "ComUsbBridgeSpeed", m_ui->cbMainComSpeed); - // addWidgetBinding("HwSettings", "TelemetrySpeed", m_ui->cbRcvrTelemSpeed); - // addWidgetBinding("HwSettings", "ComUsbBridgeSpeed", m_ui->cbRcvrComSpeed); - // Add Gps protocol configuration addWidgetBinding("GPSSettings", "DataProtocol", m_ui->cbMainGPSProtocol); addWidgetBinding("GPSSettings", "DataProtocol", m_ui->cbFlexiGPSProtocol); @@ -100,7 +100,6 @@ void ConfigSparky2HWWidget::setupCustomCombos() connect(m_ui->cbFlexi, SIGNAL(currentIndexChanged(int)), this, SLOT(flexiPortChanged(int))); connect(m_ui->cbMain, SIGNAL(currentIndexChanged(int)), this, SLOT(mainPortChanged(int))); - // connect(m_ui->cbRcvr, SIGNAL(currentIndexChanged(int)), this, SLOT(rcvrPortChanged(int))); } void ConfigSparky2HWWidget::refreshWidgetsValues(UAVObject *obj) @@ -111,7 +110,6 @@ void ConfigSparky2HWWidget::refreshWidgetsValues(UAVObject *obj) usbVCPPortChanged(0); mainPortChanged(0); flexiPortChanged(0); - // rcvrPortChanged(0); m_refreshing = false; } diff --git a/ground/gcs/src/plugins/config/configsparky2hwwidget.h b/ground/gcs/src/plugins/config/configsparky2hwwidget.h index 628863e45..e3594da3c 100644 --- a/ground/gcs/src/plugins/config/configsparky2hwwidget.h +++ b/ground/gcs/src/plugins/config/configsparky2hwwidget.h @@ -28,14 +28,13 @@ #ifndef CONFIGSPARKY2HWWIDGET_H #define CONFIGSPARKY2HWWIDGET_H -#include "ui_configsparky2hwwidget.h" #include "../uavobjectwidgetutils/configtaskwidget.h" -#include "extensionsystem/pluginmanager.h" -#include "uavobjectmanager.h" -#include "uavobject.h" -#include -#include +class Ui_Sparky2HWWidget; + +class UAVObject; + +class QWidget; class ConfigSparky2HWWidget : public ConfigTaskWidget { Q_OBJECT @@ -45,8 +44,8 @@ public: ~ConfigSparky2HWWidget(); private: - bool m_refreshing; Ui_Sparky2HWWidget *m_ui; + bool m_refreshing; void setupCustomCombos(); protected slots: diff --git a/ground/gcs/src/plugins/config/images/sparky_top.png b/ground/gcs/src/plugins/config/images/sparky_top.png deleted file mode 100644 index f163756ac..000000000 Binary files a/ground/gcs/src/plugins/config/images/sparky_top.png and /dev/null differ diff --git a/ground/gcs/src/plugins/setupwizard/pages/inputpage.cpp b/ground/gcs/src/plugins/setupwizard/pages/inputpage.cpp index dbf692dd2..8bcfe1513 100644 --- a/ground/gcs/src/plugins/setupwizard/pages/inputpage.cpp +++ b/ground/gcs/src/plugins/setupwizard/pages/inputpage.cpp @@ -1,15 +1,15 @@ /** - ****************************************************************************** + **************************************************************************************** * * @file inputpage.cpp - * @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2015. + * @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2015-2016. * The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. * @addtogroup * @{ * @addtogroup InputPage * @{ * @brief - *****************************************************************************/ + ***************************************************************************************/ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ground/gcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp b/ground/gcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp index a6daf13f6..f95665f75 100644 --- a/ground/gcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp +++ b/ground/gcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp @@ -1,5 +1,5 @@ /** - ****************************************************************************** + *********************************************************************************** * * @file vehicleconfigurationhelper.cpp * @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2015. @@ -9,7 +9,7 @@ * @addtogroup VehicleConfigurationHelper * @{ * @brief - *****************************************************************************/ + **********************************************************************************/ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -212,7 +212,7 @@ void VehicleConfigurationHelper::applyHardwareConfiguration() data.SPK2_RcvrPort = HwSettings::SPK2_RCVRPORT_SBUS; } else { data.RM_MainPort = HwSettings::RM_MAINPORT_SBUS; - // We have to set telemetry to flexport on all except Revo (and except Sparky2) since s.bus needs the mainport. + // We have to set telemetry to flexiport on all except Revo (and except Sparky2) since s.bus needs mainport. if (m_configSource->getControllerType() != VehicleConfigurationSource::CONTROLLER_REVO) { data.RM_FlexiPort = HwSettings::RM_FLEXIPORT_TELEMETRY; } @@ -1851,6 +1851,7 @@ void VehicleConfigurationHelper::setupOctoCopter() guiSettings.multi.VTOLMotorE = 3; guiSettings.multi.VTOLMotorSE = 4; guiSettings.multi.VTOLMotorS = 5; + guiSettings.multi.VTOLMotorSW = 6; guiSettings.multi.VTOLMotorW = 7; guiSettings.multi.VTOLMotorNW = 8; diff --git a/shared/uavobjectdefinition/hwsettings.xml b/shared/uavobjectdefinition/hwsettings.xml index 6eb7ff874..a93bc6009 100644 --- a/shared/uavobjectdefinition/hwsettings.xml +++ b/shared/uavobjectdefinition/hwsettings.xml @@ -11,17 +11,17 @@ - - + - - +