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

cleanup of sensor readings and sensor driver API reorganization part 1

documented L3G4200D driver why 0x28 read was suddenly turning into 0xA8
removed old wiimotion averaging cruft from computeIMU
NOT FLIGHT TESTED

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@403 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
This commit is contained in:
timecop@gmail.com 2013-09-19 11:20:53 +00:00
parent 6d3467c759
commit 14893afb32
10 changed files with 75 additions and 63 deletions

View file

@ -321,7 +321,6 @@ static float devStandardDeviation(stdev_t *dev)
static void GYRO_Common(void)
{
int axis;
static int16_t previousGyroADC[3] = { 0, 0, 0 };
static int32_t g[3];
static stdev_t var[3];
@ -355,12 +354,8 @@ static void GYRO_Common(void)
}
calibratingG--;
}
for (axis = 0; axis < 3; axis++) {
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)