未验证 提交 df57b901 编写于 作者: B Bernard Xiong 提交者: GitHub

Update thread.c

上级 7a00b42e
...@@ -543,6 +543,8 @@ rt_err_t rt_thread_delay_util(rt_tick_t *tick, rt_tick_t inc_tick) ...@@ -543,6 +543,8 @@ rt_err_t rt_thread_delay_util(rt_tick_t *tick, rt_tick_t inc_tick)
register rt_base_t level; register rt_base_t level;
struct rt_thread *thread; struct rt_thread *thread;
RT_ASSERT(tick != RT_NULL);
/* set to current thread */ /* set to current thread */
thread = rt_thread_self(); thread = rt_thread_self();
RT_ASSERT(thread != RT_NULL); RT_ASSERT(thread != RT_NULL);
...@@ -567,9 +569,6 @@ rt_err_t rt_thread_delay_util(rt_tick_t *tick, rt_tick_t inc_tick) ...@@ -567,9 +569,6 @@ rt_err_t rt_thread_delay_util(rt_tick_t *tick, rt_tick_t inc_tick)
rt_schedule(); rt_schedule();
/* get the wakeup tick */
*tick = rt_tick_get();
/* clear error number of this thread to RT_EOK */ /* clear error number of this thread to RT_EOK */
if (thread->error == -RT_ETIMEOUT) if (thread->error == -RT_ETIMEOUT)
{ {
...@@ -581,6 +580,9 @@ rt_err_t rt_thread_delay_util(rt_tick_t *tick, rt_tick_t inc_tick) ...@@ -581,6 +580,9 @@ rt_err_t rt_thread_delay_util(rt_tick_t *tick, rt_tick_t inc_tick)
rt_hw_interrupt_enable(level); rt_hw_interrupt_enable(level);
} }
/* get the wakeup tick */
*tick = rt_tick_get();
return RT_EOK; return RT_EOK;
} }
RTM_EXPORT(rt_thread_delay_util); RTM_EXPORT(rt_thread_delay_util);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册