提交 b9f5bf7d 编写于 作者: dongly's avatar dongly 提交者: mysterywolf

[libc]优化usleep函数

上级 38eb3fc4
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
* Copyright (c) 2006-2023, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
......@@ -66,12 +66,12 @@ int usleep(useconds_t usec)
if (rt_thread_self() != RT_NULL)
{
msleep(usec / 1000u);
udelay(usec % 1000u);
}
else /* scheduler has not run yet */
{
udelay(usec / 1000u * 1000u);
udelay(usec);
}
udelay(usec % 1000u);
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册