1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-22 07:45:29 +03:00

imuUpdateAccDelayed unnecessary

This commit is contained in:
borisbstyle 2015-10-01 13:49:32 +02:00
parent 4ccf9eac2e
commit b523ff1557

View file

@ -727,14 +727,6 @@ void filterRc(void){
} }
} }
bool imuUpdateAccDelayed(void) {
if (flightModeFlags) {
return false;
} else {
return true;
}
}
void loop(void) void loop(void)
{ {
static uint32_t loopTime; static uint32_t loopTime;
@ -787,7 +779,7 @@ void loop(void)
loopTime = currentTime + targetLooptime; loopTime = currentTime + targetLooptime;
// Determine current flight mode. When no acc needed in pid calculations we should only read gyro to reduce latency // Determine current flight mode. When no acc needed in pid calculations we should only read gyro to reduce latency
if (imuUpdateAccDelayed()) { if (!flightModeFlags) {
imuUpdate(&currentProfile->accelerometerTrims, ONLY_GYRO); // When no level modes active read only gyro imuUpdate(&currentProfile->accelerometerTrims, ONLY_GYRO); // When no level modes active read only gyro
} else { } else {
imuUpdate(&currentProfile->accelerometerTrims, ACC_AND_GYRO); // When level modes active read gyro and acc imuUpdate(&currentProfile->accelerometerTrims, ACC_AND_GYRO); // When level modes active read gyro and acc
@ -887,7 +879,7 @@ void loop(void)
} }
// When no level modes active read acc after motor update // When no level modes active read acc after motor update
if (imuUpdateAccDelayed()) { if (!flightModeFlags) {
imuUpdate(&currentProfile->accelerometerTrims, ONLY_ACC); imuUpdate(&currentProfile->accelerometerTrims, ONLY_ACC);
} }