summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2018-09-10 14:06:56 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-02-28 11:01:50 -0800
commit0559c39dd30862f831d2db68564d675d110cf0dd (patch)
tree2e1c945687d31f66c7f8cdaeb1831d3f1b339605
parent88976ba6340caf58a704d6eef8d60f17cc07eaf2 (diff)
downloadchrome-ec-0559c39dd30862f831d2db68564d675d110cf0dd.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,b:124085261 BRANCH=eve TEST=cheets_CTS_P.9.0_r2.x86.CtsSensorTestCases passes on eve-arcnext. (cherry picked from commit e18316ecc7f7f6d7226fc741570a94c5024d42e8) Reviewed-on: https://chromium-review.googlesource.com/1217604 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Change-Id: I34e51c0db42fe1a8d5abc91c6d80bcce974da099 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1470773 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
-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 74ec52a02b..970a151796 100644
--- a/common/motion_sense.c
+++ b/common/motion_sense.c
@@ -1207,6 +1207,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;