Keyborg: fix a bug in task_wait_event()

The match interrupt is disabled before we actually intend to. Fix it.

BUG=None
TEST=Build and boot
BRANCH=None

Change-Id: I8fb171e849809d1e4f35f00bbf6d15c9a8caad74
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/200680
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
Vic Yang
2014-05-20 16:17:35 -07:00
committed by chrome-internal-fetch
parent 98d78db982
commit 46c6d3dd1b

View File

@@ -101,11 +101,10 @@ uint32_t task_wait_event(int timeout_us)
do {
/* sleep until next interrupt */
asm volatile("wfi");
STM32_TIM_DIER(2) = 0; /* disable match interrupt */
evt = last_event;
last_event = 0;
} while (need_wfi);
STM32_TIM_DIER(2) = 0; /* disable match interrupt */
evt = last_event;
last_event = 0;
return evt;
}