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>2019-04-26 03:08:00 +0000
commit1ac37538ab3ccf16c19af528073beb6def289e49 (patch)
tree5841578a4dd4fd79650b996b5c3124112ed348f6
parentda3880fb66a2f1cd099870ff34081483a59b0154 (diff)
downloadchrome-ec-1ac37538ab3ccf16c19af528073beb6def289e49.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> (cherry picked from commit 0559c39dd30862f831d2db68564d675d110cf0dd) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1584035 Reviewed-by: Caveh Jalali <caveh@google.com> Commit-Queue: Caveh Jalali <caveh@google.com> Tested-by: Caveh Jalali <caveh@google.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;