summaryrefslogtreecommitdiff
path: root/common/gesture.c
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2014-12-29 18:40:25 -0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-12-30 22:04:05 +0000
commit9d25fa90061fecbbd34ab9be57be424ad1da1498 (patch)
tree9b73591ad7e697a12cf6507869a4d131a312a01a /common/gesture.c
parentc5a2bf58daa5c41302dab109aae9b3822560753e (diff)
downloadchrome-ec-9d25fa90061fecbbd34ab9be57be424ad1da1498.tar.gz
gesture: double tap for battery accelereomter ODR
Double the output data rate setting for accels for tap for battery because with the lsm6ds0 sensor, the current ODR does not guarantee that we get fresh data every time we do a read. BUG=chrome-os-partner:34592 BRANCH=samus TEST=load onto samus, go to G3, use tapinfo on to see ODR set to 476000Hz. add printf to lsm6ds0 to print when data is not ready, and see that without this change, the printf is hit once a minute or so, and with this change, the printf is never hit, meaning new data is always ready. Change-Id: Ib09cba0d70642f59df8a35b5b6bb4fd7b9a4fa3d Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/237665 Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Diffstat (limited to 'common/gesture.c')
-rw-r--r--common/gesture.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/common/gesture.c b/common/gesture.c
index 246d848484..9fc1e33e22 100644
--- a/common/gesture.c
+++ b/common/gesture.c
@@ -23,7 +23,11 @@
#define CPRINTF(format, args...) cprintf(CC_GESTURE, format, ## args)
/* Output datarate for tap sensor (in milli-Hz) */
-#define TAP_ODR (1000000 / CONFIG_GESTURE_SAMPLING_INTERVAL_MS)
+/*
+ * 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))
/*
* Double tap detection parameters