summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2007-03-16 23:47:03 +0000
committerJens Arnold <amiconn@rockbox.org>2007-03-16 23:47:03 +0000
commit2c7b127dd77564a8ca8c384d7d1abed441efe110 (patch)
tree95353f6db63c676890176f26fb9f452e8050d547 /firmware
parentc0351ca6338075461565b7ba14b01ba3cabb3f1e (diff)
downloadrockbox-2c7b127dd77564a8ca8c384d7d1abed441efe110.tar.gz
rockbox-2c7b127dd77564a8ca8c384d7d1abed441efe110.zip
Set CONFIG_RTC to 0 for non-RTC targets, and check with #if to profit from -Wundef. No code change.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12811 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/common/timefuncs.c4
-rw-r--r--firmware/drivers/fat.c4
-rw-r--r--firmware/export/config.h4
-rw-r--r--firmware/export/rtc.h2
4 files changed, 9 insertions, 5 deletions
diff --git a/firmware/common/timefuncs.c b/firmware/common/timefuncs.c
index e48aadd0a2..d073ec819c 100644
--- a/firmware/common/timefuncs.c
+++ b/firmware/common/timefuncs.c
@@ -46,7 +46,7 @@ bool valid_time(const struct tm *tm)
46struct tm *get_time(void) 46struct tm *get_time(void)
47{ 47{
48#ifndef SIMULATOR 48#ifndef SIMULATOR
49#ifdef CONFIG_RTC 49#if CONFIG_RTC
50 static long timeout = 0; 50 static long timeout = 0;
51 51
52 /* Don't read the RTC more than once per second */ 52 /* Don't read the RTC more than once per second */
@@ -95,7 +95,7 @@ struct tm *get_time(void)
95 95
96int set_time(const struct tm *tm) 96int set_time(const struct tm *tm)
97{ 97{
98#ifdef CONFIG_RTC 98#if CONFIG_RTC
99 int rc; 99 int rc;
100 char rtcbuf[7]; 100 char rtcbuf[7];
101 101
diff --git a/firmware/drivers/fat.c b/firmware/drivers/fat.c
index e3e1a755cb..142d750bde 100644
--- a/firmware/drivers/fat.c
+++ b/firmware/drivers/fat.c
@@ -943,7 +943,7 @@ static void fat_time(unsigned short* date,
943 unsigned short* time, 943 unsigned short* time,
944 unsigned short* tenth ) 944 unsigned short* tenth )
945{ 945{
946#ifdef CONFIG_RTC 946#if CONFIG_RTC
947 struct tm* tm = get_time(); 947 struct tm* tm = get_time();
948 948
949 if (date) 949 if (date)
@@ -1506,7 +1506,7 @@ static int update_short_entry( struct fat_file* file, long size, int attr )
1506 *sizeptr = htole32(size); 1506 *sizeptr = htole32(size);
1507 1507
1508 { 1508 {
1509#ifdef CONFIG_RTC 1509#if CONFIG_RTC
1510 unsigned short time = 0; 1510 unsigned short time = 0;
1511 unsigned short date = 0; 1511 unsigned short date = 0;
1512#else 1512#else
diff --git a/firmware/export/config.h b/firmware/export/config.h
index ae1ce5b283..c935ac466f 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -242,6 +242,10 @@
242#define CONFIG_CHARGING 0 242#define CONFIG_CHARGING 0
243#endif 243#endif
244 244
245#ifndef CONFIG_RTC
246#define CONFIG_RTC 0
247#endif
248
245/* Enable the directory cache and tagcache in RAM if we have 249/* Enable the directory cache and tagcache in RAM if we have
246 * plenty of RAM. Both features can be enabled independently. */ 250 * plenty of RAM. Both features can be enabled independently. */
247#if ((defined(MEMORYSIZE) && (MEMORYSIZE > 8)) || MEM > 8) && \ 251#if ((defined(MEMORYSIZE) && (MEMORYSIZE > 8)) || MEM > 8) && \
diff --git a/firmware/export/rtc.h b/firmware/export/rtc.h
index eea83d85bb..3d7a6d6ead 100644
--- a/firmware/export/rtc.h
+++ b/firmware/export/rtc.h
@@ -23,7 +23,7 @@
23#include "system.h" 23#include "system.h"
24#include "config.h" 24#include "config.h"
25 25
26#ifdef CONFIG_RTC 26#if CONFIG_RTC
27 27
28extern const int dayname[]; 28extern const int dayname[];
29 29