mirror of
https://github.com/wiiu-env/wut.git
synced 2025-01-07 11:58:13 +01:00
wutnewlib: Add sleep and usleep implementation.
This commit is contained in:
parent
76844067dd
commit
a5a1bac28c
@ -5,6 +5,7 @@ set_property(SOURCE crt0.s PROPERTY LANGUAGE C)
|
||||
|
||||
add_library(wutnewlib
|
||||
crt0.s
|
||||
sleep.c
|
||||
syscalls.c)
|
||||
target_include_directories(wutnewlib PRIVATE "${WUT_ROOT}/include")
|
||||
|
||||
|
14
libraries/wutnewlib/sleep.c
Normal file
14
libraries/wutnewlib/sleep.c
Normal file
@ -0,0 +1,14 @@
|
||||
#include <coreinit/thread.h>
|
||||
#include <coreinit/systeminfo.h>
|
||||
#include <coreinit/time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
unsigned sleep(unsigned seconds) {
|
||||
OSSleepTicks(OSSeconds(seconds));
|
||||
return 0;
|
||||
}
|
||||
|
||||
int usleep(useconds_t microseconds) {
|
||||
OSSleepTicks(OSMicroseconds(microseconds));
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user