mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-21 18:57:16 +08:00
添加mdelay接口
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user