mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 17:25:20 +03:00
Fixing gimbal_flags not working when feature SERVO_TILT was enabled. This was done by properly calculating servo offset instead of depending on enabled features/mixers.
This commit is contained in:
parent
ab87a99238
commit
2fef9d5fa9
6 changed files with 33 additions and 8 deletions
11
src/mixer.c
11
src/mixer.c
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* This file is part of baseflight
|
||||
* Licensed under GPL V3 or modified DCL - see https://github.com/multiwii/baseflight/blob/master/README.md
|
||||
*/
|
||||
#include "board.h"
|
||||
#include "mw.h"
|
||||
|
||||
|
@ -468,13 +472,10 @@ void mixTable(void)
|
|||
|
||||
// forward AUX1-4 to servo outputs (not constrained)
|
||||
if (cfg.gimbal_flags & GIMBAL_FORWARDAUX) {
|
||||
int offset = 0;
|
||||
int offset = core.numServos - 4;
|
||||
// offset servos based off number already used in mixer types
|
||||
// airplane and servo_tilt together can't be used
|
||||
if (mcfg.mixerConfiguration == MULTITYPE_AIRPLANE || mcfg.mixerConfiguration == MULTITYPE_FLYING_WING)
|
||||
offset = 4;
|
||||
else if (mixers[mcfg.mixerConfiguration].useServo)
|
||||
offset = 2;
|
||||
// calculate offset by taking 4 from core.numServos
|
||||
for (i = 0; i < 4; i++)
|
||||
pwmWriteServo(i + offset, rcData[AUX1 + i]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue