diff options
author | Ching-Kang Yen <chingkang@chromium.org> | 2020-01-16 16:11:40 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-12-24 06:39:55 +0000 |
commit | 57b4c76c13ad82c72aeae01ce67d8658fd81f214 (patch) | |
tree | 1e25db26acb88d3e0c13dafd21ff7d55e222edca /Makefile | |
parent | ecbc0440b48b4fe2c5ddc483eda982d29b6bc665 (diff) | |
download | chrome-ec-57b4c76c13ad82c72aeae01ce67d8658fd81f214.tar.gz |
driver: bmi160: Fix rounding error in set_offset() and get_offset()
The original set_offset() and get_offset() codes in the
driver/accelgyro_bmi160 use simple divisions to write the data.
The more times the set_offset() and get_offset() is used, the
data will get closer to 0.
Fixing it by replacing simple division to round_divide(), division
that round to nearest, in the common/math_util.c.
BRANCH=octopus
BUG=b:146823505
TEST=Testing on octopus:ampton on branch [firmware-octopus-11297.B].
Checking the data did not rounding to 0.
Change-Id: Ide9df9e32fc501e63d6f952cb8254df7662afd23
Signed-off-by: Ching-Kang Yen <chingkang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2002998
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Commit-Queue: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2600801
Tested-by: David Huang <david.huang@quanta.corp-partner.google.com>
Auto-Submit: David Huang <david.huang@quanta.corp-partner.google.com>
Diffstat (limited to 'Makefile')
0 files changed, 0 insertions, 0 deletions