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

fixed bug in mpu6050 accel code

added mpu6050 acc scale factor fixup for es/non es chips (exposed as cli option as well)


git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@191 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
This commit is contained in:
timecop 2012-08-07 08:00:16 +00:00
parent ecda218e8f
commit e894dba995
7 changed files with 1702 additions and 1693 deletions

View file

@ -35,7 +35,7 @@ void sensorsAutodetect(void)
bool havel3g4200d = false;
// Autodetect gyro hardware. We have MPU3050 or MPU6050.
if (mpu6050Detect(&acc, &gyro)) {
if (mpu6050Detect(&acc, &gyro, cfg.mpu6050_scale)) {
// this filled up acc.* struct with init values
haveMpu6k = true;
} else if (l3g4200dDetect(&gyro)) {
@ -59,7 +59,7 @@ retry:
; // fallthrough
case 2: // MPU6050
if (haveMpu6k) {
mpu6050Detect(&acc, &gyro); // yes, i'm rerunning it again. re-fill acc struct
mpu6050Detect(&acc, &gyro, cfg.mpu6050_scale); // yes, i'm rerunning it again. re-fill acc struct
accHardware = ACC_MPU6050;
if (cfg.acc_hardware == ACC_MPU6050)
break;