diff options
| author | heyuanjie <heyuanjie> | 2018-05-12 12:08:47 +0800 |
|---|---|---|
| committer | heyuanjie <heyuanjie> | 2018-05-12 12:08:47 +0800 |
| commit | 93afe69c90f93cf713513e3fcf18e7f6515b21bf (patch) | |
| tree | 724561e1cac160117256c7aadd42cde823ccab26 /src/thread.c | |
| parent | f582b621d20a3122a2d7e9baf0887a2b002718c1 (diff) | |
添加mdelay接口
Diffstat (limited to 'src/thread.c')
| -rw-r--r-- | src/thread.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/thread.c b/src/thread.c index ea0ba0bfc9..0f0265fc35 100644 --- a/src/thread.c +++ b/src/thread.c @@ -538,6 +538,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. * * @param thread the specified thread to be controlled |
