* @brief This function will let current thread delay for some milliseconds. * * @param ms The delay time in units of 1ms. * * @return Return the operation status. If the return value is `RT_EOK`, the * function is successfully executed. * If the return value is any other values, it means this operation failed. */
| 782 | * If the return value is any other values, it means this operation failed. |
| 783 | */ |
| 784 | rt_err_t rt_thread_mdelay(rt_int32_t ms) |
| 785 | { |
| 786 | rt_tick_t tick; |
| 787 | |
| 788 | tick = rt_tick_from_millisecond(ms); |
| 789 | |
| 790 | return _thread_sleep(tick); |
| 791 | } |
| 792 | RTM_EXPORT(rt_thread_mdelay); |
| 793 | |
| 794 | #ifdef RT_USING_SMP |