diff options
author | Boris Gjenero <dreamlayers@rockbox.org> | 2011-12-15 21:38:23 +0000 |
---|---|---|
committer | Boris Gjenero <dreamlayers@rockbox.org> | 2011-12-15 21:38:23 +0000 |
commit | 871c7bd34c48c74b2ac6df9a46c6b51f118f4b21 (patch) | |
tree | e9c86677bc5e1a96801b1e1b2a2b2ef9bbbba657 /firmware | |
parent | 213b8ce74b1d677014a07993ca6268cacccfe211 (diff) |
Add conditionals around functions that are only needed when RTC is present.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31301 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/common/timefuncs.c | 4 | ||||
-rw-r--r-- | firmware/include/timefuncs.h | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/firmware/common/timefuncs.c b/firmware/common/timefuncs.c index 7d385949b5..cffdb3951a 100644 --- a/firmware/common/timefuncs.c +++ b/firmware/common/timefuncs.c @@ -44,6 +44,7 @@ static void fill_default_tm(struct tm *tm) } #endif /* !CONFIG_RTC */ +#if CONFIG_RTC bool valid_time(const struct tm *tm) { if (tm->tm_hour < 0 || tm->tm_hour > 23 || @@ -57,6 +58,7 @@ bool valid_time(const struct tm *tm) else return true; } +#endif /* CONFIG_RTC */ struct tm *get_time(void) { @@ -103,6 +105,7 @@ int set_time(const struct tm *tm) #endif /* RTC */ } +#if CONFIG_RTC void set_day_of_week(struct tm *tm) { int y=tm->tm_year+1900; @@ -113,4 +116,5 @@ void set_day_of_week(struct tm *tm) if(m == 0 || m == 1) y--; tm->tm_wday = (d + mo[m] + y + y/4 - y/100 + y/400) % 7; } +#endif /* CONFIG_RTC */ diff --git a/firmware/include/timefuncs.h b/firmware/include/timefuncs.h index 86a41a516b..4c5f0fbb42 100644 --- a/firmware/include/timefuncs.h +++ b/firmware/include/timefuncs.h @@ -28,8 +28,10 @@ struct tm *get_time(void); int set_time(const struct tm *tm); +#if CONFIG_RTC bool valid_time(const struct tm *tm); void set_day_of_week(struct tm *tm); +#endif #endif /* _TIMEFUNCS_H_ */ |