From 46c6d3dd1b99452ba2ca254114c70afc0f1cc030 Mon Sep 17 00:00:00 2001 From: Vic Yang Date: Tue, 20 May 2014 16:17:35 -0700 Subject: [PATCH] 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 Reviewed-on: https://chromium-review.googlesource.com/200680 Reviewed-by: Vincent Palatin --- board/keyborg/runtime.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/board/keyborg/runtime.c b/board/keyborg/runtime.c index 89306d85fd..c7c619c46c 100644 --- a/board/keyborg/runtime.c +++ b/board/keyborg/runtime.c @@ -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; }