Browse Source

Don't treat FEATURE_CHANNEL_FORWARDING as servo usage in mixer and initialisation code (#540)

* Don't treat FEATURE_CHANNEL_FORWARDING as servo usage in mixer and initialisation code
master
Konstantin Sharlaimov 8 years ago
committed by GitHub
parent
commit
b98d94808b
  1. 8
      src/main/flight/mixer.c
  2. 2
      src/main/main.c

8
src/main/flight/mixer.c

@ -432,10 +432,10 @@ void mixerInit(mixerMode_e mixerMode, motorMixer_t *initialCustomMotorMixers, se
maxServoIndex = servoMixers[currentMixerMode].maxServoIndex;
// enable servos for mixes that require them. note, this shifts motor counts.
mixerUsesServos = mixers[currentMixerMode].useServo;
mixerUsesServos = mixers[currentMixerMode].useServo || feature(FEATURE_SERVO_TILT);
// if we want camstab/trig, that also enables servos, even if mixer doesn't
servoOutputEnabled = mixerUsesServos || feature(FEATURE_SERVO_TILT) || feature(FEATURE_CHANNEL_FORWARDING);
servoOutputEnabled = mixerUsesServos || feature(FEATURE_CHANNEL_FORWARDING);
// give all servos a default command
for (i = 0; i < MAX_SUPPORTED_SERVOS; i++) {
@ -631,7 +631,9 @@ void writeServos(void)
zeroServoValue = true;
}
if (mixerUsesServos) {
// Write mixer servo outputs
// mixerUsesServos might indicate SERVO_TILT, servoRuleCount indicate if mixer alone uses servos
if (mixerUsesServos && servoRuleCount) {
for (int i = minServoIndex; i <= maxServoIndex; i++) {
if (zeroServoValue) {
pwmWriteServo(servoIndex++, 0);

2
src/main/main.c

@ -263,7 +263,7 @@ void init(void)
pwm_params.useSerialRx = feature(FEATURE_RX_SERIAL);
#ifdef USE_SERVOS
pwm_params.useServos = isServoOutputEnabled();
pwm_params.useServos = isMixerUsingServos();
pwm_params.useChannelForwarding = feature(FEATURE_CHANNEL_FORWARDING);
pwm_params.servoCenterPulse = masterConfig.escAndServoConfig.servoCenterPulse;
pwm_params.servoPwmRate = masterConfig.servo_pwm_rate;

Loading…
Cancel
Save