diff --git a/libraries/wutnewlib/CMakeLists.txt b/libraries/wutnewlib/CMakeLists.txt index 6ae8885..0fd4391 100644 --- a/libraries/wutnewlib/CMakeLists.txt +++ b/libraries/wutnewlib/CMakeLists.txt @@ -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") diff --git a/libraries/wutnewlib/sleep.c b/libraries/wutnewlib/sleep.c new file mode 100644 index 0000000..7dd1b23 --- /dev/null +++ b/libraries/wutnewlib/sleep.c @@ -0,0 +1,14 @@ +#include +#include +#include +#include + +unsigned sleep(unsigned seconds) { + OSSleepTicks(OSSeconds(seconds)); + return 0; +} + +int usleep(useconds_t microseconds) { + OSSleepTicks(OSMicroseconds(microseconds)); + return 0; +}