summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2015-09-17 14:30:32 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2016-08-25 20:57:55 +0000
commit6ad6d519b4ab997ab3056e12ce53d35331cdc460 (patch)
treecd7b4e6a052ad8b21e2be28abd07c19ca9e0499b
parent7d35a0622eaacba10863bdbc118aba59342f7330 (diff)
downloadchrome-ec-6ad6d519b4ab997ab3056e12ce53d35331cdc460.tar.gz
UPSTREAM: motion: fix task to guarantee task never exits
Fix motion_sense task to make sure the task never exits. Note, before this change a task_wake(TASK_ID_MOTIONSENSE) would end the task because task_wait_event() would return 0. BUG=b:27849483 BRANCH=smaug, samus TEST=with following CL, run motion_lid test and make sure it passes Change-Id: I67bd2e535d67215baa0cc1dfd0010b8199152dbd Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/300630 Commit-Ready: Gwendal Grignou <gwendal@chromium.org> Tested-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> (cherry picked from commit 7a87dae5c7208f7f4264ea89fa10ba37322e838a) Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/370530
-rw-r--r--common/motion_sense.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/common/motion_sense.c b/common/motion_sense.c
index fdc36cd134..bea0bef1cf 100644
--- a/common/motion_sense.c
+++ b/common/motion_sense.c
@@ -539,7 +539,7 @@ void motion_sense_task(void)
#ifdef CONFIG_ACCEL_FIFO
ts_last_int = get_time();
#endif
- do {
+ while (1) {
ts_begin_task = get_time();
ready_status = 0;
for (i = 0; i < motion_sensor_count; ++i) {
@@ -641,7 +641,8 @@ void motion_sense_task(void)
wait_us = -1;
}
- } while ((event = task_wait_event(wait_us)));
+ event = task_wait_event(wait_us);
+ }
}
#ifdef CONFIG_ACCEL_FIFO