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-09-12 21:27:34 +0000
commite18316ecc7f7f6d7226fc741570a94c5024d42e8 (patch)
tree897ca13329d24ee9f43609e5318262d599358a9b
parentf62f2ebbecb131956a5edc4bf60c094bc67972a1 (diff)
downloadchrome-ec-e18316ecc7f7f6d7226fc741570a94c5024d42e8.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>
-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 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;