libc.h 648 B

123456789101112131415161718192021
  1. #ifndef __RTT_LIBC_H__
  2. #define __RTT_LIBC_H__
  3. #include <sys/time.h>
  4. #define MILLISECOND_PER_SECOND 1000UL
  5. #define MICROSECOND_PER_SECOND 1000000UL
  6. #define NANOSECOND_PER_SECOND 1000000000UL
  7. #define MILLISECOND_PER_TICK (MILLISECOND_PER_SECOND / RT_TICK_PER_SECOND)
  8. #define MICROSECOND_PER_TICK (MICROSECOND_PER_SECOND / RT_TICK_PER_SECOND)
  9. #define NANOSECOND_PER_TICK (NANOSECOND_PER_SECOND / RT_TICK_PER_SECOND)
  10. void libc_system_init(const char* tty_name);
  11. /* some time related function */
  12. int libc_set_time(const struct timespec *time);
  13. int libc_get_time(struct timespec *time);
  14. int libc_time_to_tick(const struct timespec *time);
  15. #endif