mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-25 17:25:18 +03:00
add USE_IMU_FAKE
This commit is contained in:
parent
19894a5a80
commit
b6483bb457
2 changed files with 8 additions and 4 deletions
|
@ -362,11 +362,11 @@ static void restartGravityCalibration(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool gravityCalibrationComplete(void)
|
static bool gravityCalibrationComplete(void)
|
||||||
{
|
{
|
||||||
if (!gyroConfig()->init_gyro_cal_enabled) {
|
if (!gyroConfig()->init_gyro_cal_enabled) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return zeroCalibrationIsCompleteS(&posEstimator.imu.gravityCalibration);
|
return zeroCalibrationIsCompleteS(&posEstimator.imu.gravityCalibration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -341,10 +341,12 @@ void gyroStartCalibration(void)
|
||||||
if (!gyro.initialized) {
|
if (!gyro.initialized) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef USE_IMU_FAKE // fixes Test Unit compilation error
|
||||||
if (!gyroConfig()->init_gyro_cal_enabled) {
|
if (!gyroConfig()->init_gyro_cal_enabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
zeroCalibrationStartV(&gyroCalibration[0], CALIBRATING_GYRO_TIME_MS, gyroConfig()->gyroMovementCalibrationThreshold, false);
|
zeroCalibrationStartV(&gyroCalibration[0], CALIBRATING_GYRO_TIME_MS, gyroConfig()->gyroMovementCalibrationThreshold, false);
|
||||||
}
|
}
|
||||||
|
@ -355,9 +357,11 @@ bool gyroIsCalibrationComplete(void)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef USE_IMU_FAKE // fixes Test Unit compilation error
|
||||||
if (!gyroConfig()->init_gyro_cal_enabled) {
|
if (!gyroConfig()->init_gyro_cal_enabled) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return zeroCalibrationIsCompleteV(&gyroCalibration[0]) && zeroCalibrationIsSuccessfulV(&gyroCalibration[0]);
|
return zeroCalibrationIsCompleteV(&gyroCalibration[0]) && zeroCalibrationIsSuccessfulV(&gyroCalibration[0]);
|
||||||
}
|
}
|
||||||
|
@ -519,7 +523,7 @@ void FAST_CODE NOINLINE gyroUpdate()
|
||||||
// At this point gyro.gyroADCf contains unfiltered gyro value [deg/s]
|
// At this point gyro.gyroADCf contains unfiltered gyro value [deg/s]
|
||||||
float gyroADCf = gyro.gyroADCf[axis];
|
float gyroADCf = gyro.gyroADCf[axis];
|
||||||
|
|
||||||
//DEBUG_SET(DEBUG_GYRO, axis, lrintf(gyroADCf));
|
DEBUG_SET(DEBUG_GYRO, axis, lrintf(gyroADCf));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* First gyro LPF is the only filter applied with the full gyro sampling speed
|
* First gyro LPF is the only filter applied with the full gyro sampling speed
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue