libc.h 644 字节
Newer Older
M
Ming, Bai 已提交
1 2 3 4 5
#ifndef __RTT_LIBC_H__
#define __RTT_LIBC_H__

#include <sys/time.h>

6 7 8
#define MILLISECOND_PER_SECOND  1000UL
#define MICROSECOND_PER_SECOND  1000000UL
#define NANOSECOND_PER_SECOND   1000000000UL
M
Ming, Bai 已提交
9

10 11 12
#define MILLISECOND_PER_TICK    (MILLISECOND_PER_SECOND / RT_TICK_PER_SECOND)
#define MICROSECOND_PER_TICK    (MICROSECOND_PER_SECOND / RT_TICK_PER_SECOND)
#define NANOSECOND_PER_TICK     (NANOSECOND_PER_SECOND  / RT_TICK_PER_SECOND)
M
Ming, Bai 已提交
13

14
int libc_system_init(void);
M
Ming, Bai 已提交
15 16 17 18 19 20 21

/* some time related function */
int libc_set_time(const struct timespec *time);
int libc_get_time(struct timespec *time);
int libc_time_to_tick(const struct timespec *time);

#endif