diff options
Diffstat (limited to 'core/cortex-m/task.c')
-rw-r--r-- | core/cortex-m/task.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/core/cortex-m/task.c b/core/cortex-m/task.c index aaa263581c..112c32299d 100644 --- a/core/cortex-m/task.c +++ b/core/cortex-m/task.c @@ -374,8 +374,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; } |