From d2dd61dfbd2097555d832940fd1774ea0d1963d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Fri, 3 Feb 2017 09:59:23 +0100 Subject: [PATCH] temperature_calibration: make sure to report an error only once --- src/modules/events/temperature_calibration/task.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/modules/events/temperature_calibration/task.cpp b/src/modules/events/temperature_calibration/task.cpp index e1a22f497e..1b7fda8a26 100644 --- a/src/modules/events/temperature_calibration/task.cpp +++ b/src/modules/events/temperature_calibration/task.cpp @@ -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();