summaryrefslogtreecommitdiff
path: root/common/motion_sense.c
diff options
context:
space:
mode:
authorYuval Peress <peress@chromium.org>2019-10-16 11:41:00 -0600
committerCommit Bot <commit-bot@chromium.org>2020-01-11 02:38:36 +0000
commit43d35e28ae67077797b0f6bc4cfd6afe2ce0e70a (patch)
tree7e268e06c9b777a3296a2784c9bc09204e26ee09 /common/motion_sense.c
parentf11df7732d4d4bfdc9b25441be5af3d5ba569cad (diff)
downloadchrome-ec-43d35e28ae67077797b0f6bc4cfd6afe2ce0e70a.tar.gz
common: motion_sense_fifo: Read temperature on stage
Assuming online calibration is enabled, and the driver implements the get_temp function. When a driver stages data, if this is the first staged sample, read the current internal sensor temperature and cache it (will later be used in commit_data()). BUG=b:138303429,chromium:1023858 BRANCH=None TEST=buildall Change-Id: I8e5404e628d3e8ded7c2d75b1b5cbac8166e97aa Signed-off-by: Yuval Peress <peress@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1867225 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'common/motion_sense.c')
-rw-r--r--common/motion_sense.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/common/motion_sense.c b/common/motion_sense.c
index 95ac60145f..bcff40d2cb 100644
--- a/common/motion_sense.c
+++ b/common/motion_sense.c
@@ -845,8 +845,10 @@ void motion_sense_task(void *u)
set_present(lpc_status);
#endif
- if (IS_ENABLED(CONFIG_ACCEL_FIFO))
+ if (IS_ENABLED(CONFIG_ACCEL_FIFO)) {
+ motion_sense_fifo_init();
ts_last_int = get_time();
+ }
while (1) {
ts_begin_task = get_time();