1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-29 07:24:13 +01:00

Mainboard config: The rcvr port is used for PPM/PWM/Spektrum so make these one

setting that is mutually exclusive.
This commit is contained in:
James Cotton 2011-09-10 14:19:12 -05:00
parent 4847a04db8
commit 01cd2ded57
4 changed files with 17 additions and 26 deletions

View File

@ -1163,12 +1163,12 @@ void PIOS_Board_Init(void) {
/* Configure the rcvr port */
uint8_t hwsettings_rcvrport;
HwSettingsRcvrPortGet(&hwsettings_rcvrport);
HwSettingsCC_RcvrPortGet(&hwsettings_rcvrport);
switch (hwsettings_rcvrport) {
case HWSETTINGS_RCVRPORT_DISABLED:
case HWSETTINGS_CC_RCVRPORT_DISABLED:
break;
case HWSETTINGS_RCVRPORT_PWM:
case HWSETTINGS_CC_RCVRPORT_PWM:
#if defined(PIOS_INCLUDE_PWM)
{
uint32_t pios_pwm_id;
@ -1182,7 +1182,7 @@ void PIOS_Board_Init(void) {
}
#endif /* PIOS_INCLUDE_PWM */
break;
case HWSETTINGS_RCVRPORT_PPM:
case HWSETTINGS_CC_RCVRPORT_PPM:
#if defined(PIOS_INCLUDE_PPM)
{
uint32_t pios_ppm_id;

View File

@ -1193,17 +1193,18 @@ void PIOS_Board_Init(void) {
PIOS_ADC_Init();
PIOS_GPIO_Init();
/* Configure the aux port */
uint8_t hwsettings_op_auxport;
HwSettingsOP_AuxPortGet(&hwsettings_op_auxport);
/* Configure the rcvr port */
uint8_t hwsettings_rcvrport;
HwSettingsOP_RcvrPortGet(&hwsettings_rcvrport);
switch (hwsettings_op_auxport) {
case HWSETTINGS_OP_AUXPORT_DISABLED:
switch (hwsettings_rcvrport) {
case HWSETTINGS_OP_RCVRPORT_DISABLED:
break;
case HWSETTINGS_OP_AUXPORT_DEBUG:
case HWSETTINGS_OP_RCVRPORT_DEBUG:
/* Not supported yet */
break;
case HWSETTINGS_OP_AUXPORT_SPEKTRUM1:
case HWSETTINGS_OP_RCVRPORT_SPEKTRUM1:
#if defined(PIOS_INCLUDE_SPEKTRUM)
{
uint32_t pios_usart_spektrum_id;
@ -1224,16 +1225,7 @@ void PIOS_Board_Init(void) {
}
#endif
break;
}
/* Configure the rcvr port */
uint8_t hwsettings_rcvrport;
HwSettingsRcvrPortGet(&hwsettings_rcvrport);
switch (hwsettings_rcvrport) {
case HWSETTINGS_RCVRPORT_DISABLED:
break;
case HWSETTINGS_RCVRPORT_PWM:
case HWSETTINGS_OP_RCVRPORT_PWM:
#if defined(PIOS_INCLUDE_PWM)
{
uint32_t pios_pwm_id;
@ -1247,7 +1239,7 @@ void PIOS_Board_Init(void) {
}
#endif /* PIOS_INCLUDE_PWM */
break;
case HWSETTINGS_RCVRPORT_PPM:
case HWSETTINGS_OP_RCVRPORT_PPM:
#if defined(PIOS_INCLUDE_PPM)
{
uint32_t pios_ppm_id;

View File

@ -43,7 +43,7 @@ ConfigCCHWWidget::ConfigCCHWWidget(QWidget *parent) : ConfigTaskWidget(parent)
addUAVObjectToWidgetRelation("TelemetrySettings","Speed",m_telemetry->telemetrySpeed);
addUAVObjectToWidgetRelation("HwSettings","CC_FlexiPort",m_telemetry->cbFlexi);
addUAVObjectToWidgetRelation("HwSettings","CC_MainPort",m_telemetry->cbTele);
addUAVObjectToWidgetRelation("HwSettings","RcvrPort",m_telemetry->cbRcvr);
addUAVObjectToWidgetRelation("HwSettings","CC_RcvrPort",m_telemetry->cbRcvr);
connect(m_telemetry->cchwHelp,SIGNAL(clicked()),this,SLOT(openHelp()));
enableControls(false);
populateWidgets();

View File

@ -3,12 +3,11 @@
<description>Selection of optional hardware configurations.</description>
<field name="CC_FlexiPort" units="function" type="enum" elements="1" options="Disabled,Telemetry,GPS,Spektrum1,Spektrum2,ComAux,I2C" defaultvalue="Disabled"/>
<field name="CC_MainPort" units="function" type="enum" elements="1" options="Disabled,Telemetry,S.Bus,GPS,Spektrum1,Spektrum2,ComAux" defaultvalue="Telemetry"/>
<field name="CC_RcvrPort" units="function" type="enum" elements="1" options="Disabled,PWM,PPM" defaultvalue="PWM"/>
<field name="OP_FlexiPort" units="function" type="enum" elements="1" options="Disabled,GPS" defaultvalue="GPS"/>
<field name="OP_MainPort" units="function" type="enum" elements="1" options="Disabled,Telemetry" defaultvalue="Telemetry"/>
<field name="OP_AuxPort" units="function" type="enum" elements="1" options="Disabled,Debug,Spektrum1" defaultvalue="Disabled"/>
<field name="RcvrPort" units="function" type="enum" elements="1" options="Disabled,PWM,PPM" defaultvalue="PWM"/>
<field name="OP_RcvrPort" units="function" type="enum" elements="1" options="Disabled,Debug,Spektrum1,PWM,PPM" defaultvalue="PWM"/>
<field name="OptionalModules" units="" type="enum" elementnames="CameraStabilization,GPS" options="Disabled,Enabled" defaultvalue="Disabled"/>
<field name="DSMxBind" units="" type="uint8" elements="1" defaultvalue="0"/>