TC: erase current calibration when temp cal is completed

This commit is contained in:
bresch 2022-11-23 11:04:53 +01:00 committed by Daniel Agar
parent d81ca65c6f
commit dae37803da
3 changed files with 22 additions and 0 deletions

View File

@ -225,5 +225,16 @@ int TemperatureCalibrationAccel::finish_sensor_instance(PerSensorData &data, int
set_parameter("TC_A%d_TMAX", sensor_index, &data.high_temp);
set_parameter("TC_A%d_TMIN", sensor_index, &data.low_temp);
set_parameter("TC_A%d_TREF", sensor_index, &data.ref_temp);
// reset current calibration (covered by TC parameters)
float offset = 0.0f;
float scale = 1.0f;
set_parameter("CAL_ACC%u_XOFF", sensor_index, &offset);
set_parameter("CAL_ACC%u_YOFF", sensor_index, &offset);
set_parameter("CAL_ACC%u_ZOFF", sensor_index, &offset);
set_parameter("CAL_ACC%u_XSCALE", sensor_index, &scale);
set_parameter("CAL_ACC%u_YSCALE", sensor_index, &scale);
set_parameter("CAL_ACC%u_ZSCALE", sensor_index, &scale);
return 0;
}

View File

@ -209,5 +209,10 @@ int TemperatureCalibrationBaro::finish_sensor_instance(PerSensorData &data, int
set_parameter("TC_B%d_TMAX", sensor_index, &data.high_temp);
set_parameter("TC_B%d_TMIN", sensor_index, &data.low_temp);
set_parameter("TC_B%d_TREF", sensor_index, &data.ref_temp);
// reset current calibration (covered by TC parameters)
float offset = 0.0f;
set_parameter("CAL_BARO%u_OFF", sensor_index, &offset);
return 0;
}

View File

@ -211,5 +211,11 @@ int TemperatureCalibrationGyro::finish_sensor_instance(PerSensorData &data, int
set_parameter("TC_G%d_TMIN", sensor_index, &data.low_temp);
set_parameter("TC_G%d_TREF", sensor_index, &data.ref_temp);
// reset current calibration (covered by TC parameters)
float offset = 0.0f;
set_parameter("CAL_GYRO%u_XOFF", sensor_index, &offset);
set_parameter("CAL_GYRO%u_YOFF", sensor_index, &offset);
set_parameter("CAL_GYRO%u_ZOFF", sensor_index, &offset);
return 0;
}