summaryrefslogtreecommitdiff
path: root/include/motion_sense.h
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2015-06-24 14:50:13 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-07-15 02:06:23 +0000
commit9edc728d541d3907edc63c2507aa619867ab9944 (patch)
tree5a5c2ec2547280d969d04223dc445798d34ddea0 /include/motion_sense.h
parentf5a6e07dd5b53397fe891bf613d411208ad11184 (diff)
downloadchrome-ec-9edc728d541d3907edc63c2507aa619867ab9944.tar.gz
motion: FIFO: add lost per vector type
When FIFO overfills, keep track of the number of lost vectors per vector types. This way, when we calculate timestamps in user space, we can evaluate the number of empty slots to skip per vector type. This is important when different types are samples at very different frequencies. BRANCH=smaug TEST=Check that when we drop events, the timestamp are better than without. BUG=chrome-os-partner:39900 Change-Id: Ib9cb994ada38373e5a49dd4ba2123ca7534a169e Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/284615 Reviewed-by: Alec Berg <alecaberg@chromium.org>
Diffstat (limited to 'include/motion_sense.h')
-rw-r--r--include/motion_sense.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/motion_sense.h b/include/motion_sense.h
index dc6c51bac9..1aeb569dd0 100644
--- a/include/motion_sense.h
+++ b/include/motion_sense.h
@@ -29,7 +29,9 @@ enum sensor_state {
#define SENSOR_ACTIVE_S0_S3_S5 (SENSOR_ACTIVE_S0_S3 | SENSOR_ACTIVE_S5)
struct motion_data_t {
+ /* data rate the sensor will measure, in mHz */
int odr;
+ /* range of measurement in SI */
int range;
};
@@ -57,7 +59,15 @@ struct motion_sensor_t {
enum chipset_state_mask active;
vector_3_t raw_xyz;
vector_3_t xyz;
+
+ /* How many flush events are pending */
uint32_t flush_pending;
+
+ /*
+ * How many vector events are lost in the FIFO since last time
+ * FIFO info has been transmitted.
+ */
+ uint16_t lost;
};
/* Defined at board level. */