diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/common/timefuncs.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/firmware/common/timefuncs.c b/firmware/common/timefuncs.c index 0371762465..1abbdf12be 100644 --- a/firmware/common/timefuncs.c +++ b/firmware/common/timefuncs.c | |||
@@ -27,6 +27,7 @@ static struct tm tm; | |||
27 | 27 | ||
28 | struct tm *get_time(void) | 28 | struct tm *get_time(void) |
29 | { | 29 | { |
30 | #ifdef HAVE_RTC | ||
30 | char rtcbuf[8]; | 31 | char rtcbuf[8]; |
31 | int i; | 32 | int i; |
32 | 33 | ||
@@ -49,5 +50,16 @@ struct tm *get_time(void) | |||
49 | tm.tm_wday = rtcbuf[4] & 0x07; | 50 | tm.tm_wday = rtcbuf[4] & 0x07; |
50 | tm.tm_yday = 0; /* Not implemented for now */ | 51 | tm.tm_yday = 0; /* Not implemented for now */ |
51 | tm.tm_isdst = -1; /* Not implemented for now */ | 52 | tm.tm_isdst = -1; /* Not implemented for now */ |
53 | #else | ||
54 | tm.tm_sec = 0; | ||
55 | tm.tm_min = 0; | ||
56 | tm.tm_hour = 0; | ||
57 | tm.tm_mday = 1; | ||
58 | tm.tm_mon = 1; | ||
59 | tm.tm_year = 1970; | ||
60 | tm.tm_wday = 1; | ||
61 | tm.tm_yday = 0; /* Not implemented for now */ | ||
62 | tm.tm_isdst = -1; /* Not implemented for now */ | ||
63 | #endif | ||
52 | return &tm; | 64 | return &tm; |
53 | } | 65 | } |