summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2018-09-10 14:06:56 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2018-10-04 22:25:55 +0000
commitbd1f5981cb1bc76a79831a37aaa9be946f88e891 (patch)
treeb187f74fc7e6763f305eaa91ed9c10ca2918744f
parent4f97fff8a0604a7ee5cdb23ff9365f0ac37bcbd9 (diff)
downloadchrome-ec-bd1f5981cb1bc76a79831a37aaa9be946f88e891.tar.gz
motion: Wake up motion task when sampling rate changes
Wake up motion task to evacuate pending samples to the host as soon as the sampling rate changes. It is required for CST testSanitizedContinuousEventsUidIdle to pass, it assumes only new samples will be present. BUG=b:111422556 BRANCH=eve TEST=cheets_CTS_P.9.0_r2.x86.CtsSensorTestCases passes on eve-arcnext. Change-Id: I34e51c0db42fe1a8d5abc91c6d80bcce974da099 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1217604 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> (cherry picked from commit e18316ecc7f7f6d7226fc741570a94c5024d42e8) Reviewed-on: https://chromium-review.googlesource.com/c/1259384 Reviewed-by: Philip Chen <philipchen@chromium.org> Commit-Queue: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org> Trybot-Ready: Philip Chen <philipchen@chromium.org>
-rw-r--r--common/motion_sense.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/motion_sense.c b/common/motion_sense.c
index 37f9eaa7a8..58e98f2d50 100644
--- a/common/motion_sense.c
+++ b/common/motion_sense.c
@@ -1165,6 +1165,10 @@ static int host_cmd_motion_sense(struct host_cmd_handler_args *args)
sensor, in->ec_rate.data * MSEC);
/* Bound the new sampling rate. */
motion_sense_set_motion_intervals();
+
+ /* Force a collection to purge old events. */
+ task_set_event(TASK_ID_MOTIONSENSE,
+ TASK_EVENT_MOTION_ODR_CHANGE, 0);
}
out->ec_rate.ret = motion_sense_ec_rate(sensor) / MSEC;