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

OP-1685 Added more OneShot code to wizard.

This commit is contained in:
m_thread 2015-02-18 12:03:43 +01:00
parent d859ad78df
commit 899cf3aa1d
2 changed files with 19 additions and 8 deletions

View File

@ -58,9 +58,14 @@ bool EscPage::validatePage()
void EscPage::initializePage()
{
ui->oneshotESCButton->setEnabled(getWizard()->getInputType() != SetupWizard::INPUT_PWM);
if (ui->oneshotESCButton->isChecked() && getWizard()->getInputType() == SetupWizard::INPUT_PWM) {
ui->oneshotESCButton->setChecked(false);
ui->rapidESCButton->setChecked(true);
if (getWizard()->getControllerType() == SetupWizard::CONTROLLER_CC ||
getWizard()->getControllerType() == SetupWizard::CONTROLLER_CC3D) {
ui->oneshotESCButton->setEnabled(getWizard()->getInputType() != SetupWizard::INPUT_PWM);
if (ui->oneshotESCButton->isChecked() && getWizard()->getInputType() == SetupWizard::INPUT_PWM) {
ui->oneshotESCButton->setChecked(false);
ui->rapidESCButton->setChecked(true);
}
} else {
ui->oneshotESCButton->setEnabled(true);
}
}

View File

@ -150,7 +150,11 @@ void VehicleConfigurationHelper::applyHardwareConfiguration()
data.CC_RcvrPort = HwSettings::CC_RCVRPORT_PWMNOONESHOT;
break;
case VehicleConfigurationSource::INPUT_PPM:
data.CC_RcvrPort = HwSettings::CC_RCVRPORT_PPMNOONESHOT;
if (m_configSource->getEscType() == VehicleConfigurationSource::ESC_ONESHOT) {
data.CC_RcvrPort = HwSettings::CC_RCVRPORT_PPM_PIN6ONESHOT;
} else {
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.
@ -373,10 +377,12 @@ void VehicleConfigurationHelper::applyActuatorConfiguration()
break;
case VehicleConfigurationSource::ESC_RAPID:
escFrequence = RAPID_ESC_FREQUENCY;
if (m_configSource->getInputType() != VehicleConfigurationSource::INPUT_PWM) {
bankMode = ActuatorSettings::BANKMODE_ONESHOT;
} else {
if ((m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_CC ||
m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_CC3D) &&
m_configSource->getInputType() == VehicleConfigurationSource::INPUT_PWM) {
bankMode = ActuatorSettings::BANKMODE_PWM;
} else {
bankMode = ActuatorSettings::BANKMODE_PWMSYNC;
}
break;
case VehicleConfigurationSource::ESC_ONESHOT: