diff options
| author | BernardXiong <[email protected]> | 2017-12-31 16:43:08 +0800 |
|---|---|---|
| committer | BernardXiong <[email protected]> | 2017-12-31 16:43:08 +0800 |
| commit | d3da3bd9b2bc6aead60a7b1ca36888e4fc03c5d8 (patch) | |
| tree | e82d528d1682814ea9edfa092ea3c627627a0923 /components/libc/timer | |
| parent | 1383a9773732253e79e2ef3625e4f79ab3b43b69 (diff) | |
[libc] move clock_time to time.
Diffstat (limited to 'components/libc/timer')
| -rw-r--r-- | components/libc/timer/SConscript | 12 | ||||
| -rw-r--r-- | components/libc/timer/posix_sleep.c | 15 |
2 files changed, 0 insertions, 27 deletions
diff --git a/components/libc/timer/SConscript b/components/libc/timer/SConscript deleted file mode 100644 index a01700aa8d..0000000000 --- a/components/libc/timer/SConscript +++ /dev/null @@ -1,12 +0,0 @@ -# RT-Thread building script for component - -from building import * - -cwd = GetCurrentDir() -src = Glob('*.c') + Glob('*.cpp') -CPPPATH = [cwd] - -group = DefineGroup('libc', src, - depend = ['RT_USING_LIBC', 'RT_USING_POSIX_TIMER'], CPPPATH = CPPPATH) - -Return('group') diff --git a/components/libc/timer/posix_sleep.c b/components/libc/timer/posix_sleep.c deleted file mode 100644 index b4b33722ac..0000000000 --- a/components/libc/timer/posix_sleep.c +++ /dev/null @@ -1,15 +0,0 @@ -#include <stdlib.h> -#include <rtthread.h> - -#include <unistd.h> - -unsigned int sleep(unsigned int seconds) -{ - rt_tick_t delta_tick; - - delta_tick = rt_tick_get(); - rt_thread_delay(seconds * RT_TICK_PER_SECOND); - delta_tick = rt_tick_get() - delta_tick; - - return seconds - delta_tick/RT_TICK_PER_SECOND; -} |
