mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-22 07:45:29 +03:00
imuUpdateAccDelayed unnecessary
This commit is contained in:
parent
4ccf9eac2e
commit
b523ff1557
1 changed files with 2 additions and 10 deletions
|
@ -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(¤tProfile->accelerometerTrims, ONLY_GYRO); // When no level modes active read only gyro
|
imuUpdate(¤tProfile->accelerometerTrims, ONLY_GYRO); // When no level modes active read only gyro
|
||||||
} else {
|
} else {
|
||||||
imuUpdate(¤tProfile->accelerometerTrims, ACC_AND_GYRO); // When level modes active read gyro and acc
|
imuUpdate(¤tProfile->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(¤tProfile->accelerometerTrims, ONLY_ACC);
|
imuUpdate(¤tProfile->accelerometerTrims, ONLY_ACC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue