mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
temperature_calibration: make sure to report an error only once
This commit is contained in:
parent
fe53e3a0d5
commit
d2dd61dfbd
@ -127,6 +127,7 @@ void TemperatureCalibration::task_main()
|
||||
|
||||
//init calibrators
|
||||
TemperatureCalibrationBase *calibrators[3];
|
||||
bool error_reported[3] = {};
|
||||
int num_calibrators = 0;
|
||||
|
||||
if (_accel) {
|
||||
@ -200,7 +201,10 @@ void TemperatureCalibration::task_main()
|
||||
ret = calibrators[i]->update();
|
||||
|
||||
if (ret < 0) {
|
||||
PX4_ERR("Calibration update step failed (%i)", ret);
|
||||
if (!error_reported[i]) {
|
||||
PX4_ERR("Calibration update step failed (%i)", ret);
|
||||
error_reported[i] = true;
|
||||
}
|
||||
|
||||
} else if (ret < min_progress) {
|
||||
min_progress = ret;
|
||||
@ -220,6 +224,8 @@ void TemperatureCalibration::task_main()
|
||||
}
|
||||
}
|
||||
|
||||
PX4_INFO("Sensor Measurments completed");
|
||||
|
||||
// do final calculations & parameter storage
|
||||
for (int i = 0; i < num_calibrators; ++i) {
|
||||
int ret = calibrators[i]->finish();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user