Merge pull request #1428 from heyuanjie87/imx1050

添加mdelay接口
This commit is contained in:
Bernard Xiong 2018-05-12 12:37:19 +08:00 committed by GitHub
commit d2336a6988
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 0 deletions

View File

@ -149,6 +149,7 @@ rt_err_t rt_thread_delete(rt_thread_t thread);
rt_err_t rt_thread_yield(void);
rt_err_t rt_thread_delay(rt_tick_t tick);
rt_err_t rt_thread_mdelay(rt_int32_t ms);
rt_err_t rt_thread_control(rt_thread_t thread, int cmd, void *arg);
rt_err_t rt_thread_suspend(rt_thread_t thread);
rt_err_t rt_thread_resume(rt_thread_t thread);

View File

@ -537,6 +537,23 @@ rt_err_t rt_thread_delay(rt_tick_t tick)
}
RTM_EXPORT(rt_thread_delay);
/**
* This function will let current thread delay for some milliseconds.
*
* @param tick the delay time
*
* @return RT_EOK
*/
rt_err_t rt_thread_mdelay(rt_int32_t ms)
{
rt_tick_t tick;
tick = rt_tick_from_millisecond(ms);
return rt_thread_sleep(tick);
}
RTM_EXPORT(rt_thread_mdelay);
/**
* This function will control thread behaviors according to control command.
*