1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-25 01:05:27 +03:00

Make gyro calibration period user configurable and rename moron_threshold

Gryo calibration period can be configured in 1/100 second intervals using `gyro_calib_duration` (default is 125 or 1.25 seconds).

Renamed the `moron_threshold` parameter to `gyro_calib_noise_limit`. Functionally it is unchanged.
This commit is contained in:
Bruce Luckcuck 2018-05-21 07:35:31 -04:00
parent 346201d8ac
commit 8f6f4bf4c4
4 changed files with 6 additions and 3 deletions

View file

@ -187,6 +187,7 @@ PG_REGISTER_WITH_RESET_TEMPLATE(gyroConfig_t, gyroConfig, PG_GYRO_CONFIG, 2);
PG_RESET_TEMPLATE(gyroConfig_t, gyroConfig,
.gyro_align = ALIGN_DEFAULT,
.gyroCalibrationDuration = 125, // 1.25 seconds
.gyroMovementCalibrationThreshold = 48,
.gyro_sync_denom = GYRO_SYNC_DENOM_DEFAULT,
.gyro_hardware_lpf = GYRO_HARDWARE_LPF_NORMAL,
@ -877,7 +878,7 @@ static bool isOnFinalGyroCalibrationCycle(const gyroCalibration_t *gyroCalibrati
static int32_t gyroCalculateCalibratingCycles(void)
{
return (CALIBRATING_GYRO_TIME_US / gyro.targetLooptime);
return (gyroConfig()->gyroCalibrationDuration * 10000) / gyro.targetLooptime;
}
static bool isOnFirstGyroCalibrationCycle(const gyroCalibration_t *gyroCalibration)