1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-26 01:35:41 +03:00

Refactor tripcopter case

This commit is contained in:
jflyper 2019-09-03 15:10:06 +09:00
parent e9c951ea51
commit a5c4c8c21f

View file

@ -336,18 +336,11 @@ void writeServos(void)
switch (currentMixerMode) { switch (currentMixerMode) {
case MIXER_TRI: case MIXER_TRI:
case MIXER_CUSTOM_TRI: case MIXER_CUSTOM_TRI:
if (servosTricopterIsEnabledServoUnarmed()) { // We move servo if unarmed flag set or armed
// if unarmed flag set, we always move servo if (!(servosTricopterIsEnabledServoUnarmed() || ARMING_FLAG(ARMED))) {
writeServoWithTracking(servoIndex++, SERVO_RUDDER); servo[SERVO_RUDDER] = 0; // kill servo signal completely.
} else {
// otherwise, only move servo when copter is armed
if (ARMING_FLAG(ARMED)) {
writeServoWithTracking(servoIndex++, SERVO_RUDDER);
} else {
pwmWriteServo(servoIndex++, 0); // kill servo signal completely.
servoWritten |= (1 << SERVO_RUDDER);
}
} }
writeServoWithTracking(servoIndex++, SERVO_RUDDER);
break; break;
case MIXER_FLYING_WING: case MIXER_FLYING_WING: