1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-14 11:59:58 +03:00

fixed mma driver ID;

fixed a boner #ifdef typo in imu.c
go back to gyro glitch stuff in sensors.c
do gyrocal during acc cal as well

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@164 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
This commit is contained in:
timecop 2012-06-14 04:12:23 +00:00
parent 8fb580d3f5
commit f73ccdd0a9
5 changed files with 2541 additions and 2523 deletions

View file

@ -272,6 +272,7 @@ void Baro_update(void)
static void GYRO_Common(void)
{
static int16_t previousGyroADC[3] = { 0, 0, 0 };
static int32_t g[3];
uint8_t axis;
@ -293,6 +294,12 @@ static void GYRO_Common(void)
}
calibratingG--;
}
for (axis = 0; axis < 3; axis++) {
gyroADC[axis] -= gyroZero[axis];
//anti gyro glitch, limit the variation between two consecutive readings
gyroADC[axis] = constrain(gyroADC[axis], previousGyroADC[axis] - 800, previousGyroADC[axis] + 800);
previousGyroADC[axis] = gyroADC[axis];
}
}
void Gyro_getADC(void)