summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2021-10-02 00:43:02 -0700
committerCommit Bot <commit-bot@chromium.org>2021-10-08 23:13:31 +0000
commitea2429c9ef443757533fc1f9aad80ab3739da463 (patch)
tree37aae870a1266a911c6c86b7ef87f6d5202646f0
parent1b5a630588b7f56ed7b8f2ae91bb448c971e7d92 (diff)
downloadchrome-ec-ea2429c9ef443757533fc1f9aad80ab3739da463.tar.gz
motion_sense: Fix Fix ap_event_interval calculation
Improve precision of the new_rate_us calculation. Fixes: motion_sense: Fix ap_event_interval calculation ("5155d9c7bfc42aa3f53572e0389a8180d7f3a366") BUG=b:195264765,b:129159505,b:73557414 BRANCH=many. TEST=compile Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Change-Id: I4b3d54dedceca5652004da14f32dac6ae98747fa Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3200808 Reviewed-by: Rob Barnes <robbarnes@google.com> Reviewed-by: Diana Z <dzigterman@chromium.org>
-rw-r--r--common/motion_sense.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/motion_sense.c b/common/motion_sense.c
index f37b284268..6a93e15dde 100644
--- a/common/motion_sense.c
+++ b/common/motion_sense.c
@@ -232,7 +232,7 @@ static int motion_sense_set_ec_rate_from_ap(
* One will have a delay guarantee to be less than its ODR.
*/
if (SECOND * 1100 / odr_mhz > new_rate_us)
- new_rate_us = new_rate_us / 95 * 100;
+ new_rate_us = new_rate_us * 95 / 100;
end_set_ec_rate_from_ap:
return MAX(new_rate_us, motion_min_interval);