From e18316ecc7f7f6d7226fc741570a94c5024d42e8 Mon Sep 17 00:00:00 2001 From: Gwendal Grignou Date: Mon, 10 Sep 2018 14:06:56 -0700 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/1217604 Reviewed-by: Aseda Aboagye --- common/motion_sense.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/motion_sense.c b/common/motion_sense.c index 702c44771b..cd80833211 100644 --- a/common/motion_sense.c +++ b/common/motion_sense.c @@ -1061,6 +1061,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; -- cgit v1.2.1