diff options
Diffstat (limited to 'firmware/target/hosted/rtc.c')
-rw-r--r-- | firmware/target/hosted/rtc.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/firmware/target/hosted/rtc.c b/firmware/target/hosted/rtc.c index c5bf9816a9..178e797a8d 100644 --- a/firmware/target/hosted/rtc.c +++ b/firmware/target/hosted/rtc.c | |||
@@ -22,11 +22,12 @@ | |||
22 | ****************************************************************************/ | 22 | ****************************************************************************/ |
23 | #include <time.h> | 23 | #include <time.h> |
24 | #include <sys/time.h> | 24 | #include <sys/time.h> |
25 | #if !defined(WIN32) | ||
25 | #include <sys/ioctl.h> | 26 | #include <sys/ioctl.h> |
26 | #include <linux/rtc.h> | 27 | #include <linux/rtc.h> |
27 | #include <fcntl.h> | 28 | #include <fcntl.h> |
28 | #include <unistd.h> | 29 | #include <unistd.h> |
29 | 30 | #endif | |
30 | void rtc_init(void) | 31 | void rtc_init(void) |
31 | { | 32 | { |
32 | } | 33 | } |
@@ -41,12 +42,12 @@ int rtc_read_datetime(struct tm *tm) | |||
41 | 42 | ||
42 | int rtc_write_datetime(const struct tm *tm) | 43 | int rtc_write_datetime(const struct tm *tm) |
43 | { | 44 | { |
44 | #if defined(AGPTEK_ROCKER) | 45 | #if defined(AGPTEK_ROCKER) && !defined(WIN32) |
45 | struct timeval tv; | 46 | struct timeval tv; |
46 | struct tm *tm_time; | 47 | struct tm *tm_time; |
47 | 48 | ||
48 | int rtc = open("/dev/rtc0", O_WRONLY); | 49 | int rtc = open("/dev/rtc0", O_WRONLY); |
49 | 50 | ||
50 | tv.tv_sec = mktime((struct tm *)tm); | 51 | tv.tv_sec = mktime((struct tm *)tm); |
51 | tv.tv_usec = 0; | 52 | tv.tv_usec = 0; |
52 | 53 | ||