From a4da83a1be30510dda0bef2cf5a6de28b508aa2d Mon Sep 17 00:00:00 2001 From: Alessio Morale Date: Sun, 8 Feb 2015 17:36:42 +0100 Subject: [PATCH] OP-1685 - Add OneShot compatible configurations --- .../coptercontrol/firmware/pios_board.c | 22 +++++++++---------- .../plugins/setupwizard/pages/inputpage.cpp | 4 ++-- .../vehicleconfigurationhelper.cpp | 6 ++--- shared/uavobjectdefinition/hwsettings.xml | 2 +- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/flight/targets/boards/coptercontrol/firmware/pios_board.c b/flight/targets/boards/coptercontrol/firmware/pios_board.c index 62232d832..e255c5482 100644 --- a/flight/targets/boards/coptercontrol/firmware/pios_board.c +++ b/flight/targets/boards/coptercontrol/firmware/pios_board.c @@ -713,7 +713,7 @@ void PIOS_Board_Init(void) HwSettingsCC_RcvrPortGet(&hwsettings_rcvrport); switch (hwsettings_rcvrport) { - case HWSETTINGS_CC_RCVRPORT_DISABLED: + case HWSETTINGS_CC_RCVRPORT_DISABLEDONESHOT: #if defined(PIOS_INCLUDE_HCSR04) { uint32_t pios_hcsr04_id; @@ -721,7 +721,7 @@ void PIOS_Board_Init(void) } #endif break; - case HWSETTINGS_CC_RCVRPORT_PWM: + case HWSETTINGS_CC_RCVRPORT_PWMNOONESHOT: #if defined(PIOS_INCLUDE_PWM) { uint32_t pios_pwm_id; @@ -735,8 +735,8 @@ void PIOS_Board_Init(void) } #endif /* PIOS_INCLUDE_PWM */ break; - case HWSETTINGS_CC_RCVRPORT_PPM: - case HWSETTINGS_CC_RCVRPORT_PPMOUTPUTS: + case HWSETTINGS_CC_RCVRPORT_PPMNOONESHOT: + case HWSETTINGS_CC_RCVRPORT_PPMOUTPUTSNOONESHOT: #if defined(PIOS_INCLUDE_PPM) { uint32_t pios_ppm_id; @@ -750,7 +750,7 @@ void PIOS_Board_Init(void) } #endif /* PIOS_INCLUDE_PPM */ break; - case HWSETTINGS_CC_RCVRPORT_PPMPWM: + case HWSETTINGS_CC_RCVRPORT_PPMPWMNOONESHOT: /* This is a combination of PPM and PWM inputs */ #if defined(PIOS_INCLUDE_PPM) { @@ -795,14 +795,14 @@ void PIOS_Board_Init(void) #ifndef PIOS_ENABLE_DEBUG_PINS switch (hwsettings_rcvrport) { - case HWSETTINGS_CC_RCVRPORT_DISABLED: - case HWSETTINGS_CC_RCVRPORT_PWM: - case HWSETTINGS_CC_RCVRPORT_PPM: - case HWSETTINGS_CC_RCVRPORT_PPMPWM: + case HWSETTINGS_CC_RCVRPORT_DISABLEDONESHOT: + case HWSETTINGS_CC_RCVRPORT_PWMNOONESHOT: + case HWSETTINGS_CC_RCVRPORT_PPMNOONESHOT: + case HWSETTINGS_CC_RCVRPORT_PPMPWMNOONESHOT: PIOS_Servo_Init(&pios_servo_cfg); break; - case HWSETTINGS_CC_RCVRPORT_PPMOUTPUTS: - case HWSETTINGS_CC_RCVRPORT_OUTPUTS: + case HWSETTINGS_CC_RCVRPORT_PPMOUTPUTSNOONESHOT: + case HWSETTINGS_CC_RCVRPORT_OUTPUTSONESHOT: PIOS_Servo_Init(&pios_servo_rcvr_cfg); break; } diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/inputpage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/inputpage.cpp index c74931300..849284e68 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/inputpage.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/inputpage.cpp @@ -77,10 +77,10 @@ bool InputPage::restartNeeded(VehicleConfigurationSource::INPUT_TYPE selectedTyp { switch (selectedType) { case VehicleConfigurationSource::INPUT_PWM: - return data.CC_RcvrPort != HwSettings::CC_RCVRPORT_PWM; + return data.CC_RcvrPort != HwSettings::CC_RCVRPORT_PWMNOONESHOT; case VehicleConfigurationSource::INPUT_PPM: - return data.CC_RcvrPort != HwSettings::CC_RCVRPORT_PPM; + return data.CC_RcvrPort != HwSettings::CC_RCVRPORT_PPMNOONESHOT; case VehicleConfigurationSource::INPUT_SBUS: return data.CC_MainPort != HwSettings::CC_MAINPORT_SBUS; diff --git a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp index 81bf4fd40..3fc3ea1fc 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp @@ -139,7 +139,7 @@ void VehicleConfigurationHelper::applyHardwareConfiguration() case VehicleConfigurationSource::CONTROLLER_CC: case VehicleConfigurationSource::CONTROLLER_CC3D: // Reset all ports - data.CC_RcvrPort = HwSettings::CC_RCVRPORT_DISABLED; + data.CC_RcvrPort = HwSettings::CC_RCVRPORT_DISABLEDONESHOT; // Default mainport to be active telemetry link data.CC_MainPort = HwSettings::CC_MAINPORT_TELEMETRY; @@ -147,10 +147,10 @@ void VehicleConfigurationHelper::applyHardwareConfiguration() data.CC_FlexiPort = HwSettings::CC_FLEXIPORT_DISABLED; switch (m_configSource->getInputType()) { case VehicleConfigurationSource::INPUT_PWM: - data.CC_RcvrPort = HwSettings::CC_RCVRPORT_PWM; + data.CC_RcvrPort = HwSettings::CC_RCVRPORT_PWMNOONESHOT; break; case VehicleConfigurationSource::INPUT_PPM: - data.CC_RcvrPort = HwSettings::CC_RCVRPORT_PPM; + data.CC_RcvrPort = HwSettings::CC_RCVRPORT_PPMNOONESHOT; break; case VehicleConfigurationSource::INPUT_SBUS: // We have to set teletry on flexport since s.bus needs the mainport. diff --git a/shared/uavobjectdefinition/hwsettings.xml b/shared/uavobjectdefinition/hwsettings.xml index 2fb566340..3daac0180 100644 --- a/shared/uavobjectdefinition/hwsettings.xml +++ b/shared/uavobjectdefinition/hwsettings.xml @@ -1,7 +1,7 @@ Selection of optional hardware configurations. - +