1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

OP-816 Added settings enums for GPS and Revolution Radio modem.

Added basic hardware settings implementation for Revolution board.
This commit is contained in:
Fredrik Arvidsson 2013-04-07 11:52:33 +02:00
parent e40e4a1815
commit 9d53b68ab8
3 changed files with 47 additions and 1 deletions

View File

@ -58,6 +58,12 @@ public:
void setESCType(SetupWizard::ESC_TYPE type) { m_escType = type; }
SetupWizard::ESC_TYPE getESCType() const { return m_escType; }
void setGPSSetting(SetupWizard::GPS_SETTING setting) { m_gpsSetting = setting; }
SetupWizard::GPS_SETTING getGPSSetting() const {return m_gpsSetting;}
void setRadioSetting(SetupWizard::RADIO_SETTING setting) { m_radioSetting = setting; }
SetupWizard::RADIO_SETTING getRadioSetting() const {return m_radioSetting;}
void setLevellingBias(accelGyroBias bias) { m_levellingBias = bias; m_levellingPerformed = true; }
bool isLevellingPerformed() const { return m_levellingPerformed; }
accelGyroBias getLevellingBias() const { return m_levellingBias; }
@ -96,6 +102,9 @@ private:
INPUT_TYPE m_inputType;
ESC_TYPE m_escType;
GPS_SETTING m_gpsSetting;
RADIO_SETTING m_radioSetting;
bool m_levellingPerformed;
accelGyroBias m_levellingBias;

View File

@ -141,7 +141,38 @@ void VehicleConfigurationHelper::applyHardwareConfiguration()
}
break;
case VehicleConfigurationSource::CONTROLLER_REVO:
// TODO: Implement Revo settings
// Reset all ports
data.RM_RcvrPort = HwSettings::RM_RCVRPORT_DISABLED;
//Default mainport to be active telemetry link
data.RM_MainPort = HwSettings::RM_MAINPORT_TELEMETRY;
data.RM_FlexiPort = HwSettings::RM_FLEXIPORT_DISABLED;
switch(m_configSource->getInputType())
{
case VehicleConfigurationSource::INPUT_PWM:
data.RM_RcvrPort = HwSettings::RM_RCVRPORT_PWM;
break;
case VehicleConfigurationSource::INPUT_PPM:
data.RM_RcvrPort = HwSettings::RM_RCVRPORT_PPM;
break;
case VehicleConfigurationSource::INPUT_SBUS:
// We have to set teletry on flexport since s.bus needs the mainport.
data.RM_MainPort = HwSettings::RM_MAINPORT_SBUS;
data.RM_FlexiPort = HwSettings::RM_FLEXIPORT_TELEMETRY;
break;
case VehicleConfigurationSource::INPUT_DSMX10:
data.RM_FlexiPort = HwSettings::RM_FLEXIPORT_DSMX10BIT;
break;
case VehicleConfigurationSource::INPUT_DSMX11:
data.RM_FlexiPort = HwSettings::RM_FLEXIPORT_DSMX11BIT;
break;
case VehicleConfigurationSource::INPUT_DSM2:
data.RM_FlexiPort = HwSettings::RM_FLEXIPORT_DSM2;
break;
default:
break;
}
break;
default:
break;

View File

@ -65,12 +65,18 @@ public:
enum ESC_TYPE {ESC_RAPID, ESC_LEGACY, ESC_UNKNOWN};
enum INPUT_TYPE {INPUT_PWM, INPUT_PPM, INPUT_SBUS, INPUT_DSMX10, INPUT_DSMX11, INPUT_DSM2, INPUT_UNKNOWN};
enum GPS_SETTING {GPS_UBX, GPS_NMEA, GPS_DISABLED};
enum RADIO_SETTING {RADIO_TELEMETRY, RADIO_DISABLED};
virtual VehicleConfigurationSource::CONTROLLER_TYPE getControllerType() const = 0;
virtual VehicleConfigurationSource::VEHICLE_TYPE getVehicleType() const = 0;
virtual VehicleConfigurationSource::VEHICLE_SUB_TYPE getVehicleSubType() const = 0;
virtual VehicleConfigurationSource::INPUT_TYPE getInputType() const = 0;
virtual VehicleConfigurationSource::ESC_TYPE getESCType() const = 0;
virtual VehicleConfigurationSource::GPS_SETTING getGPSSetting() const = 0;
virtual VehicleConfigurationSource::RADIO_SETTING getRadioSetting() const = 0;
virtual bool isLevellingPerformed() const = 0;
virtual accelGyroBias getLevellingBias() const = 0;