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

Moved accelerometerTrims into accelerometerConfig()

This commit is contained in:
Martin Budden 2016-12-07 11:48:29 +00:00
parent a562b8fa12
commit ee8a1676c4
11 changed files with 21 additions and 32 deletions

View file

@ -65,7 +65,6 @@ float fc_acc;
float smallAngleCosZ = 0;
float magneticDeclination = 0.0f; // calculated at startup from config
static bool isAccelUpdatedAtLeastOnce = false;
static imuRuntimeConfig_t imuRuntimeConfig;
static pidProfile_t *pidProfile;
@ -406,17 +405,9 @@ static void imuCalculateEstimatedAttitude(timeUs_t currentTimeUs)
imuCalculateAcceleration(deltaT); // rotate acc vector into earth frame
}
void imuUpdateAccelerometer(rollAndPitchTrims_t *accelerometerTrims)
{
if (sensors(SENSOR_ACC)) {
updateAccelerationReadings(accelerometerTrims);
isAccelUpdatedAtLeastOnce = true;
}
}
void imuUpdateAttitude(timeUs_t currentTimeUs)
{
if (sensors(SENSOR_ACC) && isAccelUpdatedAtLeastOnce) {
if (sensors(SENSOR_ACC) && acc.isAccelUpdatedAtLeastOnce) {
imuCalculateEstimatedAttitude(currentTimeUs);
} else {
acc.accSmooth[X] = 0;