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=none
BRANCH=smaug
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>
This commit is contained in:
Alec Berg
2015-09-17 14:30:32 -07:00
committed by chrome-bot
parent 5dfe8d2674
commit 7a87dae5c7

View File

@@ -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