summaryrefslogtreecommitdiff
path: root/include/motion_sense.h
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2015-08-07 22:45:21 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-08-24 19:08:15 +0000
commitde42bb285fa45a777ed7a27be9f4c99c8f606ed8 (patch)
treeafaecf0636aaab1932243b5f5bd9e198cc08e73f /include/motion_sense.h
parent5faadc6748d556375c1effd56dac226f2a773ad1 (diff)
downloadchrome-ec-de42bb285fa45a777ed7a27be9f4c99c8f606ed8.tar.gz
motion_sense: calculate threshold properly
Working on light sensor, sensor were read on every time, SENSOR_EC_THRES was not taken into account. Fix 64/32 conversions and add a function for dealing with rollover. TEST=Set light sensor probe at 1s. Set accel sensor at 100Hz to fill fifo often; verify that light sensor is queried every second only. BRANCH=smaug BUG=chrome-os-partner:39900 Change-Id: If1df53c1a9a304c992f8e517f5d516210118a437 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/291992 Reviewed-by: Sheng-liang Song <ssl@chromium.org>
Diffstat (limited to 'include/motion_sense.h')
-rw-r--r--include/motion_sense.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/motion_sense.h b/include/motion_sense.h
index 7acd22225d..cbe311fdf6 100644
--- a/include/motion_sense.h
+++ b/include/motion_sense.h
@@ -101,7 +101,7 @@ struct motion_sensor_t {
* For sensor without FIFO, time since the last event was collect
* from sensor registers.
*/
- int last_collection;
+ uint32_t last_collection;
};
/* Defined at board level. */