1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-25 14:54:16 +01:00

OP-1685 - Add OneShot compatible configurations

This commit is contained in:
Alessio Morale 2015-02-08 17:36:42 +01:00
parent f290d6d89d
commit a4da83a1be
4 changed files with 17 additions and 17 deletions
flight/targets/boards/coptercontrol/firmware
ground/openpilotgcs/src/plugins/setupwizard
shared/uavobjectdefinition

@ -713,7 +713,7 @@ void PIOS_Board_Init(void)
HwSettingsCC_RcvrPortGet(&hwsettings_rcvrport); HwSettingsCC_RcvrPortGet(&hwsettings_rcvrport);
switch (hwsettings_rcvrport) { switch (hwsettings_rcvrport) {
case HWSETTINGS_CC_RCVRPORT_DISABLED: case HWSETTINGS_CC_RCVRPORT_DISABLEDONESHOT:
#if defined(PIOS_INCLUDE_HCSR04) #if defined(PIOS_INCLUDE_HCSR04)
{ {
uint32_t pios_hcsr04_id; uint32_t pios_hcsr04_id;
@ -721,7 +721,7 @@ void PIOS_Board_Init(void)
} }
#endif #endif
break; break;
case HWSETTINGS_CC_RCVRPORT_PWM: case HWSETTINGS_CC_RCVRPORT_PWMNOONESHOT:
#if defined(PIOS_INCLUDE_PWM) #if defined(PIOS_INCLUDE_PWM)
{ {
uint32_t pios_pwm_id; uint32_t pios_pwm_id;
@ -735,8 +735,8 @@ void PIOS_Board_Init(void)
} }
#endif /* PIOS_INCLUDE_PWM */ #endif /* PIOS_INCLUDE_PWM */
break; break;
case HWSETTINGS_CC_RCVRPORT_PPM: case HWSETTINGS_CC_RCVRPORT_PPMNOONESHOT:
case HWSETTINGS_CC_RCVRPORT_PPMOUTPUTS: case HWSETTINGS_CC_RCVRPORT_PPMOUTPUTSNOONESHOT:
#if defined(PIOS_INCLUDE_PPM) #if defined(PIOS_INCLUDE_PPM)
{ {
uint32_t pios_ppm_id; uint32_t pios_ppm_id;
@ -750,7 +750,7 @@ void PIOS_Board_Init(void)
} }
#endif /* PIOS_INCLUDE_PPM */ #endif /* PIOS_INCLUDE_PPM */
break; break;
case HWSETTINGS_CC_RCVRPORT_PPMPWM: case HWSETTINGS_CC_RCVRPORT_PPMPWMNOONESHOT:
/* This is a combination of PPM and PWM inputs */ /* This is a combination of PPM and PWM inputs */
#if defined(PIOS_INCLUDE_PPM) #if defined(PIOS_INCLUDE_PPM)
{ {
@ -795,14 +795,14 @@ void PIOS_Board_Init(void)
#ifndef PIOS_ENABLE_DEBUG_PINS #ifndef PIOS_ENABLE_DEBUG_PINS
switch (hwsettings_rcvrport) { switch (hwsettings_rcvrport) {
case HWSETTINGS_CC_RCVRPORT_DISABLED: case HWSETTINGS_CC_RCVRPORT_DISABLEDONESHOT:
case HWSETTINGS_CC_RCVRPORT_PWM: case HWSETTINGS_CC_RCVRPORT_PWMNOONESHOT:
case HWSETTINGS_CC_RCVRPORT_PPM: case HWSETTINGS_CC_RCVRPORT_PPMNOONESHOT:
case HWSETTINGS_CC_RCVRPORT_PPMPWM: case HWSETTINGS_CC_RCVRPORT_PPMPWMNOONESHOT:
PIOS_Servo_Init(&pios_servo_cfg); PIOS_Servo_Init(&pios_servo_cfg);
break; break;
case HWSETTINGS_CC_RCVRPORT_PPMOUTPUTS: case HWSETTINGS_CC_RCVRPORT_PPMOUTPUTSNOONESHOT:
case HWSETTINGS_CC_RCVRPORT_OUTPUTS: case HWSETTINGS_CC_RCVRPORT_OUTPUTSONESHOT:
PIOS_Servo_Init(&pios_servo_rcvr_cfg); PIOS_Servo_Init(&pios_servo_rcvr_cfg);
break; break;
} }

@ -77,10 +77,10 @@ bool InputPage::restartNeeded(VehicleConfigurationSource::INPUT_TYPE selectedTyp
{ {
switch (selectedType) { switch (selectedType) {
case VehicleConfigurationSource::INPUT_PWM: case VehicleConfigurationSource::INPUT_PWM:
return data.CC_RcvrPort != HwSettings::CC_RCVRPORT_PWM; return data.CC_RcvrPort != HwSettings::CC_RCVRPORT_PWMNOONESHOT;
case VehicleConfigurationSource::INPUT_PPM: case VehicleConfigurationSource::INPUT_PPM:
return data.CC_RcvrPort != HwSettings::CC_RCVRPORT_PPM; return data.CC_RcvrPort != HwSettings::CC_RCVRPORT_PPMNOONESHOT;
case VehicleConfigurationSource::INPUT_SBUS: case VehicleConfigurationSource::INPUT_SBUS:
return data.CC_MainPort != HwSettings::CC_MAINPORT_SBUS; return data.CC_MainPort != HwSettings::CC_MAINPORT_SBUS;

@ -139,7 +139,7 @@ void VehicleConfigurationHelper::applyHardwareConfiguration()
case VehicleConfigurationSource::CONTROLLER_CC: case VehicleConfigurationSource::CONTROLLER_CC:
case VehicleConfigurationSource::CONTROLLER_CC3D: case VehicleConfigurationSource::CONTROLLER_CC3D:
// Reset all ports // Reset all ports
data.CC_RcvrPort = HwSettings::CC_RCVRPORT_DISABLED; data.CC_RcvrPort = HwSettings::CC_RCVRPORT_DISABLEDONESHOT;
// Default mainport to be active telemetry link // Default mainport to be active telemetry link
data.CC_MainPort = HwSettings::CC_MAINPORT_TELEMETRY; data.CC_MainPort = HwSettings::CC_MAINPORT_TELEMETRY;
@ -147,10 +147,10 @@ void VehicleConfigurationHelper::applyHardwareConfiguration()
data.CC_FlexiPort = HwSettings::CC_FLEXIPORT_DISABLED; data.CC_FlexiPort = HwSettings::CC_FLEXIPORT_DISABLED;
switch (m_configSource->getInputType()) { switch (m_configSource->getInputType()) {
case VehicleConfigurationSource::INPUT_PWM: case VehicleConfigurationSource::INPUT_PWM:
data.CC_RcvrPort = HwSettings::CC_RCVRPORT_PWM; data.CC_RcvrPort = HwSettings::CC_RCVRPORT_PWMNOONESHOT;
break; break;
case VehicleConfigurationSource::INPUT_PPM: case VehicleConfigurationSource::INPUT_PPM:
data.CC_RcvrPort = HwSettings::CC_RCVRPORT_PPM; data.CC_RcvrPort = HwSettings::CC_RCVRPORT_PPMNOONESHOT;
break; break;
case VehicleConfigurationSource::INPUT_SBUS: case VehicleConfigurationSource::INPUT_SBUS:
// We have to set teletry on flexport since s.bus needs the mainport. // We have to set teletry on flexport since s.bus needs the mainport.

@ -1,7 +1,7 @@
<xml> <xml>
<object name="HwSettings" singleinstance="true" settings="true" category="System"> <object name="HwSettings" singleinstance="true" settings="true" category="System">
<description>Selection of optional hardware configurations.</description> <description>Selection of optional hardware configurations.</description>
<field name="CC_RcvrPort" units="function" type="enum" elements="1" options="Disabled,PWM,PPM,PPM+PWM,PPM+Outputs,Outputs" defaultvalue="PWM"/> <field name="CC_RcvrPort" units="function" type="enum" elements="1" options="Disabled+OneShot,PWM+NoOneShot,PPM+NoOneShot,PPM+PWM+NoOneShot,PPM+Outputs+NoOneShot,PPM_PIN6+OneShot, Outputs+OneShot" defaultvalue="PWM+NoOneShot"/>
<field name="CC_MainPort" units="function" type="enum" elements="1" options="Disabled,Telemetry,GPS,S.Bus,DSM,DebugConsole,ComBridge,OsdHk" defaultvalue="Telemetry"/> <field name="CC_MainPort" units="function" type="enum" elements="1" options="Disabled,Telemetry,GPS,S.Bus,DSM,DebugConsole,ComBridge,OsdHk" defaultvalue="Telemetry"/>
<field name="CC_FlexiPort" units="function" type="enum" elements="1" options="Disabled,Telemetry,GPS,I2C,PPM,DSM,DebugConsole,ComBridge,OsdHk" defaultvalue="Disabled"/> <field name="CC_FlexiPort" units="function" type="enum" elements="1" options="Disabled,Telemetry,GPS,I2C,PPM,DSM,DebugConsole,ComBridge,OsdHk" defaultvalue="Disabled"/>