Browse Source

tri gyro data reading fix - closes issue #18

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@464 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
master
timecop@gmail.com 11 years ago
parent
commit
609df47cd4
  1. 6487
      obj/baseflight.hex
  2. 6
      src/imu.c

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

6
src/imu.c

@ -67,12 +67,14 @@ void computeIMU(void)
Smoothing[YAW] = (mcfg.gyro_smoothing_factor) & 0xff;
}
for (axis = 0; axis < 3; axis++) {
gyroData[axis] = (int16_t)(((int32_t)((int32_t)gyroSmooth[axis] * (Smoothing[axis] - 1)) + gyroData[axis] + 1) / Smoothing[axis]);
gyroData[axis] = (int16_t)(((int32_t)((int32_t)gyroSmooth[axis] * (Smoothing[axis] - 1)) + gyroADC[axis] + 1) / Smoothing[axis]);
gyroSmooth[axis] = gyroData[axis];
}
} else if (mcfg.mixerConfiguration == MULTITYPE_TRI) {
gyroData[YAW] = (gyroYawSmooth * 2 + gyroData[YAW]) / 3;
gyroData[YAW] = (gyroYawSmooth * 2 + gyroADC[YAW]) / 3;
gyroYawSmooth = gyroData[YAW];
gyroData[ROLL] = gyroADC[ROLL];
gyroData[PITCH] = gyroADC[PITCH];
} else {
for (axis = 0; axis < 3; axis++)
gyroData[axis] = gyroADC[axis];

Loading…
Cancel
Save