diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2015-11-12 00:45:27 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2015-11-15 07:16:37 -0800 |
commit | 96b65354878587df434becfbc5d707a687c85fa4 (patch) | |
tree | c1b18e7bff9cf87b15038f8efb9bfc5555eb231e /include/motion_sense.h | |
parent | d68cb398ab9b76eeab57230c32dd7c476c5e3377 (diff) | |
download | chrome-ec-96b65354878587df434becfbc5d707a687c85fa4.tar.gz |
motion: fix oversampling formula
Overly complex previous formula could lead the EC to throw all samples
between 2 timestamps and put 2 event within one timestamp.
That would confuse the kernel. If the motion sense task is delayed while
this happen, the delta between the 2 samples could be so long that
CTS test cts.SingleSensorTests would fail.
BRANCH=smaug
BUG=b:24367625
TEST=Loops of cts.SingleSensorTests pass.
Change-Id: I29e6bf354ccb7ecf741a91116854d6abe07558dc
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/312364
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'include/motion_sense.h')
-rw-r--r-- | include/motion_sense.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/motion_sense.h b/include/motion_sense.h index 7dd9fd747d..89203dd040 100644 --- a/include/motion_sense.h +++ b/include/motion_sense.h @@ -108,8 +108,11 @@ struct motion_sensor_t { /* * Allow EC to request an higher frequency for the sensors than the AP. + * We will downsample according to oversampling_ratio, or ignore the + * samples altogether if oversampling_ratio is 0. */ - fp_t oversampling; + uint16_t oversampling; + uint16_t oversampling_ratio; /* * How many vector events are lost in the FIFO since last time |