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:
parent
e9c951ea51
commit
a5c4c8c21f
1 changed files with 4 additions and 11 deletions
|
@ -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:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue