summaryrefslogtreecommitdiff
path: root/core/cortex-m0/task.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/cortex-m0/task.c')
-rw-r--r--core/cortex-m0/task.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/cortex-m0/task.c b/core/cortex-m0/task.c
index b5f9aef40c..3bbee70cae 100644
--- a/core/cortex-m0/task.c
+++ b/core/cortex-m0/task.c
@@ -361,8 +361,11 @@ static uint32_t __wait_evt(int timeout_us, task_id_t resched)
__schedule(1, resched);
resched = TASK_ID_IDLE;
}
- if (timeout_us > 0)
+ if (timeout_us > 0) {
timer_cancel(me);
+ /* Ensure timer event is clear, we no longer care about it */
+ atomic_clear(&tsk->events, TASK_EVENT_TIMER);
+ }
return evt;
}