fix issue 31 (#32)
[lunaix-os.git] / lunaix-os / includes / lunaix / clock.h
1 #ifndef __LUNAIX_CLOCK_H
2 #define __LUNAIX_CLOCK_H
3
4 #include <lunaix/time.h>
5
6 #include <hal/hwrtc.h>
7 #include <hal/hwtimer.h>
8
9 extern const struct hwrtc* sysrtc;
10 extern const struct hwtimer* systimer;
11
12 void
13 clock_init();
14
15 void
16 clock_walltime(datetime_t* datetime);
17
18 /**
19  * @brief 返回当前系统时间,即自从开机到当前时刻的毫秒时。
20  *
21  * @return time_t
22  */
23 time_t
24 clock_systime();
25
26 time_t
27 clock_unixtime();
28
29 #endif /* __LUNAIX_CLOCK_H */