From cdf80a868a6c4c25a8f463fe77befa337b4c0dcd Mon Sep 17 00:00:00 2001 From: Paul Riseborough Date: Thu, 9 Feb 2017 15:33:05 +1100 Subject: [PATCH] events: don't start gyro calibration until minimum temperature achieved --- src/modules/events/temperature_calibration/gyro.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/events/temperature_calibration/gyro.cpp b/src/modules/events/temperature_calibration/gyro.cpp index 04a167d58d..437068e424 100644 --- a/src/modules/events/temperature_calibration/gyro.cpp +++ b/src/modules/events/temperature_calibration/gyro.cpp @@ -96,6 +96,11 @@ int TemperatureCalibrationGyro::update_sensor_instance(PerSensorData &data, int data.sensor_sample_filt[2] = gyro_data.z; data.sensor_sample_filt[3] = gyro_data.temperature; + // wait for min start temp to be reached before starting calibration + if (data.sensor_sample_filt[3] < _min_start_temperature) { + return 1; + } + if (!data.cold_soaked) { data.cold_soaked = true; data.low_temp = data.sensor_sample_filt[3]; //Record the low temperature