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

Split up imuUpdate for gyro and acc

This commit is contained in:
borisbstyle 2015-12-05 12:52:43 +01:00
parent 81299e34de
commit b3f0bd1402
3 changed files with 14 additions and 17 deletions

View file

@ -774,11 +774,11 @@ void loop(void)
haveProcessedRxOnceBeforeLoop = false;
imuUpdateGyro();
// Determine current flight mode. When no acc needed in pid calculations we should only read gyro to reduce latency
if (!flightModeFlags) {
imuUpdate(&currentProfile->accelerometerTrims, ONLY_GYRO); // When no level modes active read only gyro
} else {
imuUpdate(&currentProfile->accelerometerTrims, ACC_AND_GYRO); // When level modes active read gyro and acc
if (flightModeFlags) {
imuUpdateAcc(&currentProfile->accelerometerTrims); // When level modes active read gyro and acc
}
// Measure loop rate just after reading the sensors
@ -859,7 +859,7 @@ void loop(void)
// When no level modes active read acc after motor update
if (!flightModeFlags) {
imuUpdate(&currentProfile->accelerometerTrims, ONLY_ACC);
imuUpdateAcc(&currentProfile->accelerometerTrims);
}
#ifdef BLACKBOX