diff --git a/components/libc/time/posix_sleep.c b/components/libc/time/posix_sleep.c index d45b3b945f..e50bda7d4a 100644 --- a/components/libc/time/posix_sleep.c +++ b/components/libc/time/posix_sleep.c @@ -8,6 +8,7 @@ * 2020-12-16 Meco Man add usleep */ #include +#include #include unsigned int sleep(unsigned int seconds) @@ -23,5 +24,7 @@ unsigned int sleep(unsigned int seconds) int usleep(useconds_t usec) { - + rt_thread_mdelay(usec / 1000u); + rt_hw_us_delay(usec % 1000u); + return 0; }