diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2021-10-02 00:43:02 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-11-17 19:57:37 +0000 |
commit | 4de1ad3fd2aca06e0036739f7bb5ad12afc76635 (patch) | |
tree | c4a868575ec4b37d890eefdf10f75960d0fc929f | |
parent | 5aa1437a0d931b3a4ae990de30d0ae505deb1202 (diff) | |
download | chrome-ec-4de1ad3fd2aca06e0036739f7bb5ad12afc76635.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>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3288754
Reviewed-by: Ting Shen <phoenixshen@chromium.org>
-rw-r--r-- | common/motion_sense.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/common/motion_sense.c b/common/motion_sense.c index 4f25397080..83cea63781 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); |