diff options
author | David Jacobs <davejacobs@google.com> | 2018-06-19 01:50:11 -0400 |
---|---|---|
committer | David Jacobs <davejacobs@google.com> | 2018-06-19 02:06:07 -0400 |
commit | e37bcfce975a2243f7ed4328d703642a48d70819 (patch) | |
tree | 25d2e75375e27d744b5ca3d6646d952303f30867 | |
parent | 3c1833228fcf029ff393c7dd4d57bf9f15f3228d (diff) | |
download | device_google_contexthub-android-9.0.0_r34.tar.gz device_google_contexthub-android-9.0.0_r34.tar.bz2 device_google_contexthub-android-9.0.0_r34.zip |
[OVER TEMP CAL] -- Update Valid Model Checkandroid-9.0.0_r47android-9.0.0_r46android-9.0.0_r45android-9.0.0_r44android-9.0.0_r43android-9.0.0_r42android-9.0.0_r41android-9.0.0_r40android-9.0.0_r39android-9.0.0_r38android-9.0.0_r37android-9.0.0_r36android-9.0.0_r35android-9.0.0_r34android-9.0.0_r33android-9.0.0_r32android-9.0.0_r31android-9.0.0_r30android-9.0.0_r22android-9.0.0_r21android-9.0.0_r20android-9.0.0_r19android-9.0.0_r16pie-qpr3-s1-releasepie-qpr3-releasepie-qpr3-b-releasepie-qpr2-releasepie-qpr1-s3-releasepie-qpr1-s2-releasepie-qpr1-s1-releasepie-qpr1-releasepie-dr1-devpie-b4s4-releasepie-b4s4-dev
Updates the isValidOtcLinearModel function to ensure that
over-temp linear model updates are accepted for devices
where gyro temperature sensitivity is nearly zero.
Tip of G3: 201100998
Bug: 110109779
Test: Built and device tested.
Change-Id: If461ac7f915774baf03c406ee3f7db32b4fe3190
-rw-r--r-- | firmware/os/algos/calibration/over_temp/over_temp_cal.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/firmware/os/algos/calibration/over_temp/over_temp_cal.c b/firmware/os/algos/calibration/over_temp/over_temp_cal.c index 04a9c924..84d7411f 100644 --- a/firmware/os/algos/calibration/over_temp/over_temp_cal.c +++ b/firmware/os/algos/calibration/over_temp/over_temp_cal.c @@ -1444,10 +1444,13 @@ bool isValidOtcLinearModel(const struct OverTempCal *over_temp_cal, float temp_sensitivity, float sensor_intercept) { ASSERT_NOT_NULL(over_temp_cal); + // Simple check to ensure that the linear model parameters are: + // 1. Within the valid range, AND + // 2. At least one model parameter is considered non-zero. return NANO_ABS(temp_sensitivity) < over_temp_cal->temp_sensitivity_limit && NANO_ABS(sensor_intercept) < over_temp_cal->sensor_intercept_limit && - NANO_ABS(temp_sensitivity) > OTC_MODELDATA_NEAR_ZERO_TOL && - NANO_ABS(sensor_intercept) > OTC_MODELDATA_NEAR_ZERO_TOL; + (NANO_ABS(temp_sensitivity) > OTC_MODELDATA_NEAR_ZERO_TOL || + NANO_ABS(sensor_intercept) > OTC_MODELDATA_NEAR_ZERO_TOL); } bool isValidOtcOffset(const float *offset, float offset_temp_celsius) { |