summaryrefslogtreecommitdiff
path: root/common/motion_lid.c
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@google.com>2021-05-05 14:34:06 -0700
committerCommit Bot <commit-bot@chromium.org>2021-05-06 00:29:36 +0000
commit6a0678dbe2bb8a77ad438b5232b5c1a1747369fe (patch)
tree4962e00fbd2d1a61874069331f9b78574cd62327 /common/motion_lid.c
parent30b6aea0a17d71049098aec236ea6a11b8145a53 (diff)
downloadchrome-ec-6a0678dbe2bb8a77ad438b5232b5c1a1747369fe.tar.gz
common: lid angle calculation: Exclude any measurement over 1.1g
When a given axis is reporting 1.1g or over, it means the device is moving. The constant representing the limit was not set properly. BUG=b:187338766 TEST=unittests. BRANCH=none Signed-off-by: Gwendal Grignou <gwendal@google.com> Change-Id: I36e38b5d7957ecaccc2c4e088d9aa506af6a2315 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2875484 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Gwendal Grignou <gwendal@chromium.org> Tested-by: Gwendal Grignou <gwendal@chromium.org>
Diffstat (limited to 'common/motion_lid.c')
-rw-r--r--common/motion_lid.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/motion_lid.c b/common/motion_lid.c
index 0ab0dd9238..1d84c17eff 100644
--- a/common/motion_lid.c
+++ b/common/motion_lid.c
@@ -78,7 +78,7 @@ static intv3_t smoothed_base, smoothed_lid;
* is less than 1<<31, so magnitude is less sqrt(2)*(1<<15), less than ~40% over
* 1g. This is way above any usable noise. Assume noise is less than 10%.
*/
-#define MOTION_SCALING_AXIS_MAX (MOTION_SCALING_FACTOR * 110)
+#define MOTION_SCALING_AXIS_MAX ((MOTION_SCALING_FACTOR * 110) / 100)
#define MOTION_SCALING_FACTOR2 (MOTION_SCALING_FACTOR * MOTION_SCALING_FACTOR)