git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Support to multi-threading and pthread interface (POSIX.1-2008) (#23)
[lunaix-os.git]
/
lunaix-os
/
includes
/
lunaix
/
clock.h
diff --git
a/lunaix-os/includes/lunaix/clock.h
b/lunaix-os/includes/lunaix/clock.h
index dbfdfe5d8b13a79bf40430c0a2f9e6f1730bde7f..58e1ead7886ab1f7993e171bfd51d1c2422d1ec3 100644
(file)
--- a/
lunaix-os/includes/lunaix/clock.h
+++ b/
lunaix-os/includes/lunaix/clock.h
@@
-1,36
+1,29
@@
#ifndef __LUNAIX_CLOCK_H
#define __LUNAIX_CLOCK_H
#ifndef __LUNAIX_CLOCK_H
#define __LUNAIX_CLOCK_H
-#include <
stdint
.h>
+#include <
lunaix/time
.h>
-typedef uint32_t time_t;
+#include <hal/hwrtc.h>
+#include <hal/hwtimer.h>
-typedef struct
-{
- uint32_t year; // use int32 as we need to store the 4-digit year
- uint8_t month;
- uint8_t day;
- uint8_t weekday;
- uint8_t hour;
- uint8_t minute;
- uint8_t second;
-} datetime_t;
+extern const struct hwrtc* sysrtc;
+extern const struct hwtimer* systimer;
void
clock_init();
void
clock_init();
-void
+void
clock_walltime(datetime_t* datetime);
clock_walltime(datetime_t* datetime);
-int
-clock_datatime_eq(datetime_t* a, datetime_t* b);
-
/**
* @brief 返回当前系统时间,即自从开机到当前时刻的毫秒时。
/**
* @brief 返回当前系统时间,即自从开机到当前时刻的毫秒时。
- *
- * @return time_t
+ *
+ * @return time_t
*/
*/
-time_t
+time_t
clock_systime();
clock_systime();
+time_t
+clock_unixtime();
+
#endif /* __LUNAIX_CLOCK_H */
#endif /* __LUNAIX_CLOCK_H */