diff --git a/src/main/sensors/gyro.c b/src/main/sensors/gyro.c index 619b0175ef..c75dc87914 100644 --- a/src/main/sensors/gyro.c +++ b/src/main/sensors/gyro.c @@ -746,7 +746,7 @@ static bool isOnFinalGyroCalibrationCycle(const gyroCalibration_t *gyroCalibrati static uint16_t gyroCalculateCalibratingCycles(void) { - return (CALIBRATING_GYRO_CYCLES / gyro.targetLooptime) * CALIBRATING_GYRO_CYCLES; + return (CALIBRATING_GYRO_TIME_US / gyro.targetLooptime); } static bool isOnFirstGyroCalibrationCycle(const gyroCalibration_t *gyroCalibration) @@ -789,7 +789,7 @@ STATIC_UNIT_TESTED void performGyroCalibration(gyroSensor_t *gyroSensor, uint8_t gyroSensor->gyroDev.gyroZero[axis] = 0; } - // Sum up CALIBRATING_GYRO_CYCLES readings + // Sum up CALIBRATING_GYRO_TIME_US readings gyroSensor->calibration.sum[axis] += gyroSensor->gyroDev.gyroADCRaw[axis]; devPush(&gyroSensor->calibration.var[axis], gyroSensor->gyroDev.gyroADCRaw[axis]); diff --git a/src/main/sensors/sensors.h b/src/main/sensors/sensors.h index 556ef9d4e8..60ecaaff5f 100644 --- a/src/main/sensors/sensors.h +++ b/src/main/sensors/sensors.h @@ -40,7 +40,7 @@ typedef union flightDynamicsTrims_u { flightDynamicsTrims_def_t values; } flightDynamicsTrims_t; -#define CALIBRATING_GYRO_CYCLES 10000 +#define CALIBRATING_GYRO_TIME_US 3000000 #define CALIBRATING_ACC_CYCLES 400 #define CALIBRATING_BARO_CYCLES 200 // 10 seconds init_delay + 200 * 25 ms = 15 seconds before ground pressure settles