1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-17 05:15:25 +03:00

Split gyro device out of gyro sensor struct

This commit is contained in:
Martin Budden 2017-02-05 22:24:13 +00:00
parent 9a8124ffc4
commit f2b423525d
16 changed files with 168 additions and 77 deletions

View file

@ -63,11 +63,8 @@ bool sensorsAutodetect(void)
accInit(gyro.targetLooptime);
mag.magneticDeclination = 0.0f; // TODO investigate if this is actually needed if there is no mag sensor or if the value stored in the config should be used.
#ifdef MAG
if (compassDetect(&mag.dev, compassConfig()->mag_hardware)) {
compassInit();
}
compassInit();
#endif
#ifdef BARO
@ -80,15 +77,5 @@ bool sensorsAutodetect(void)
}
#endif
if (gyroConfig()->gyro_align != ALIGN_DEFAULT) {
gyro.dev.gyroAlign = gyroConfig()->gyro_align;
}
if (accelerometerConfig()->acc_align != ALIGN_DEFAULT) {
acc.dev.accAlign = accelerometerConfig()->acc_align;
}
if (compassConfig()->mag_align != ALIGN_DEFAULT) {
mag.dev.magAlign = compassConfig()->mag_align;
}
return true;
}