mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-30 15:52:12 +01:00
OP-1685 - Add OneShot compatible configurations
This commit is contained in:
parent
f290d6d89d
commit
a4da83a1be
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<xml>
|
||||
<object name="HwSettings" singleinstance="true" settings="true" category="System">
|
||||
<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_FlexiPort" units="function" type="enum" elements="1" options="Disabled,Telemetry,GPS,I2C,PPM,DSM,DebugConsole,ComBridge,OsdHk" defaultvalue="Disabled"/>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user