Tenok
A Linux-like Real-Time Operating System for Robotics and Internet of Things
time.h
Go to the documentation of this file.
1 
4 #ifndef __KERNEL_TIME_H__
5 #define __KERNEL_TIME_H__
6 
7 #include <stdbool.h>
8 #include <time.h>
9 
10 #include <common/list.h>
11 
12 struct timer {
13  int id;
14  int flags;
15  bool enabled;
16  struct sigevent sev;
17  struct itimerspec setting;
18  struct itimerspec ret_time; /* For returning current time */
19  struct timespec counter; /* Internal countdown counter */
20  struct thread_info *thread; /* The thread that the timer belongs to */
21  struct list_head g_list; /* Linked to the global timer list */
22  struct list_head list; /* Linked to the thread timer list */
23 };
24 
25 void timer_up_count(struct timespec *time);
26 void timer_down_count(struct timespec *time);
27 void time_add(struct timespec *time, time_t sec, long nsec);
28 void get_sys_time(struct timespec *tp);
29 void set_sys_time(const struct timespec *tp);
30 void system_timer_update(void);
31 
32 #endif
Definition: time.h:19
Definition: list.h:111
Definition: signal.h:47
Definition: kernel.h:68
Definition: time.h:12
Definition: time.h:14