summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2018-08-16 15:45:24 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-08-17 11:17:51 -0700
commit75c4ca92679fbfae01d4e9d7fd0798425f41c38e (patch)
tree3048734b9327483deef659be63c77ad4f87c7220
parent06da274d74afc02e4d65cb9e843aa809ffea9931 (diff)
downloadchrome-ec-75c4ca92679fbfae01d4e9d7fd0798425f41c38e.tar.gz
board: eve: Do not set accelerometer ODR beyond 200Hz
When ODR is set above 200Hz, the EC can not keep up with the accelerometer, causing deadlock. ODR was set at 400Hz for double tap detection. However, that high frequency is only needed for LSM6DS0 where tap detection is done in software (samus). 200Hz is good enough when tap detection is done in hardware. BUG=b:112672627 BRANCH=eve TEST=Check eve is done dead locking at boot. Check double tap still works. Change-Id: Id41dc06eb357b1cdc78d22b89440f01c44a3c16c Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1179182 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r--board/samus/board.c4
-rw-r--r--include/gesture.h3
2 files changed, 4 insertions, 3 deletions
diff --git a/board/samus/board.c b/board/samus/board.c
index c26f08137d..d95975bb18 100644
--- a/board/samus/board.c
+++ b/board/samus/board.c
@@ -337,11 +337,11 @@ struct motion_sensor_t motion_sensors[] = {
},
/* Used for double tap */
[SENSOR_CONFIG_EC_S3] = {
- .odr = TAP_ODR | ROUND_UP_FLAG,
+ .odr = TAP_ODR_LSM6DS0 | ROUND_UP_FLAG,
.ec_rate = CONFIG_GESTURE_SAMPLING_INTERVAL_MS * MSEC,
},
[SENSOR_CONFIG_EC_S5] = {
- .odr = TAP_ODR | ROUND_UP_FLAG,
+ .odr = TAP_ODR_LSM6DS0 | ROUND_UP_FLAG,
.ec_rate = CONFIG_GESTURE_SAMPLING_INTERVAL_MS * MSEC,
},
},
diff --git a/include/gesture.h b/include/gesture.h
index d480794758..85419c20fc 100644
--- a/include/gesture.h
+++ b/include/gesture.h
@@ -21,6 +21,7 @@ void gesture_calc(uint32_t *event);
* Note: lsm6ds0 accel needs twice the expected data rate in order to guarantee
* that we have a new data sample every reading.
*/
-#define TAP_ODR (2 * (1000000 / CONFIG_GESTURE_SAMPLING_INTERVAL_MS))
+#define TAP_ODR (1000000 / CONFIG_GESTURE_SAMPLING_INTERVAL_MS)
+#define TAP_ODR_LSM6DS0 (2 * TAP_ODR)
#endif /* __CROS_EC_GESTURE_H */