summaryrefslogtreecommitdiff
path: root/driver/accel_bma2x2.c
diff options
context:
space:
mode:
authorMarco Chen <marcochen@google.com>2018-03-24 16:12:34 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-03-26 14:41:34 -0700
commit67ee456782c8af0a9a2ab044cfac6712db94f033 (patch)
tree4f896d0079dad12862892e0fbdc714da2b31de9f /driver/accel_bma2x2.c
parent9849d847e7e888f9588f9e2d14db19366e0dedac (diff)
downloadchrome-ec-67ee456782c8af0a9a2ab044cfac6712db94f033.tar.gz
sensor: bmi160/bma2x2: Fix the timeout value of compensation.
CL:957872 introduced "get_time().val + 400" as the deadline to perform compensation and the comment in bma2x2.c mentioned the deadline should be 400ms. But the unit of val in timestamp_t is microsecond not milisecond so only 400us is defined not 400ms. BRANCH=none BUG=b:76234078 BUG=b:76202592 TEST=test manually on the dut by performing calibrate. Change-Id: I7a834ef6dcb0772569d2c8d6c507803deb5d2fc1 Signed-off-by: Marco Chen <marcochen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/979512 Commit-Ready: Gwendal Grignou <gwendal@chromium.org> Tested-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Diffstat (limited to 'driver/accel_bma2x2.c')
-rw-r--r--driver/accel_bma2x2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/driver/accel_bma2x2.c b/driver/accel_bma2x2.c
index fcb9cf478d..7548b5d3be 100644
--- a/driver/accel_bma2x2.c
+++ b/driver/accel_bma2x2.c
@@ -235,7 +235,7 @@ static int perform_calib(const struct motion_sensor_t *s)
* The sensor needs 16 samples. At 100Hz/10ms, it needs 160ms to
* complete. Set 400ms to have some margin.
*/
- deadline.val = get_time().val + 400;
+ deadline.val = get_time().val + 400 * MSEC;
do {
if (timestamp_expired(deadline, NULL)) {
ret = EC_RES_TIMEOUT;