1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 14:25:20 +03:00

Removed dependency of pwm_output driver on mixers and servos

This commit is contained in:
Martin Budden 2017-02-17 13:42:33 +00:00
parent 367f62236a
commit 781b1b1352
22 changed files with 103 additions and 93 deletions

View file

@ -282,25 +282,25 @@ void init(void)
idlePulse = flight3DConfig()->neutral3d;
}
if (motorConfig()->motorPwmProtocol == PWM_TYPE_BRUSHED) {
if (motorConfig()->dev.motorPwmProtocol == PWM_TYPE_BRUSHED) {
featureClear(FEATURE_3D);
idlePulse = 0; // brushed motors
}
mixerConfigureOutput();
motorInit(motorConfig(), idlePulse, getMotorCount());
motorInit(&motorConfig()->dev, idlePulse, getMotorCount());
#ifdef USE_SERVOS
servoConfigureOutput();
if (isMixerUsingServos()) {
//pwm_params.useChannelForwarding = feature(FEATURE_CHANNEL_FORWARDING);
servoInit(servoConfig());
servoInit(&servoConfig()->dev);
}
#endif
#if defined(USE_PWM) || defined(USE_PPM)
if (feature(FEATURE_RX_PPM)) {
ppmRxInit(ppmConfig(), motorConfig()->motorPwmProtocol);
ppmRxInit(ppmConfig(), motorConfig()->dev.motorPwmProtocol);
} else if (feature(FEATURE_RX_PARALLEL_PWM)) {
pwmRxInit(pwmConfig());
}