Browse Source

Added GIMBAL_MIXTILT (16) to gimbal_flags. Setting gimbal_flags=16 will use "mixed" gimbal i.e. SERVO_MIX_TILT from MultiWii. Untested, but should work(tm).

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@239 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
master
timecop@gmail.com 12 years ago
parent
commit
006e6629f6
  1. 5708
      obj/baseflight.hex
  2. 5
      src/mixer.c
  3. 1
      src/mw.h

5708
obj/baseflight.hex
File diff suppressed because it is too large
View File

5
src/mixer.c

@ -346,9 +346,14 @@ void mixTable(void)
servo[1] = cfg.gimbal_roll_mid + aux[1];
if (rcOptions[BOXCAMSTAB]) {
if (cfg.gimbal_flags & GIMBAL_MIXTILT) {
servo[0] = (-cfg.gimbal_roll_gain) * angle[PITCH] / 16 - cfg.gimbal_roll_gain * angle[ROLL] / 16;
servo[1] = (-cfg.gimbal_roll_gain) * angle[PITCH] / 16 - cfg.gimbal_roll_gain * angle[ROLL] / 16;
} else {
servo[0] += cfg.gimbal_pitch_gain * angle[PITCH] / 16;
servo[1] += cfg.gimbal_roll_gain * angle[ROLL] / 16;
}
}
servo[0] = constrain(servo[0], cfg.gimbal_pitch_min, cfg.gimbal_pitch_max);
servo[1] = constrain(servo[1], cfg.gimbal_roll_min, cfg.gimbal_roll_max);

1
src/mw.h

@ -47,6 +47,7 @@ typedef enum GimbalFlags {
GIMBAL_TILTONLY = 1 << 1,
GIMBAL_DISABLEAUX34 = 1 << 2,
GIMBAL_FORWARDAUX = 1 << 3,
GIMBAL_MIXTILT = 1 << 4,
} GimbalFlags;
/*********** RC alias *****************/

Loading…
Cancel
Save