summaryrefslogtreecommitdiff
path: root/apps
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 /apps
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 'apps')
-rw-r--r--apps/gui/gwps-common.c2
-rw-r--r--apps/gui/statusbar.c8
-rw-r--r--apps/gui/statusbar.h2
-rw-r--r--apps/main.c2
-rw-r--r--apps/menus/main_menu.c2
-rw-r--r--apps/menus/settings_menu.c4
-rw-r--r--apps/misc.c4
-rw-r--r--apps/misc.h4
-rw-r--r--apps/plugins/SOURCES2
-rw-r--r--apps/plugins/bounce.c8
-rw-r--r--apps/plugins/calendar.c6
-rw-r--r--apps/recorder/icons.h2
-rw-r--r--apps/recorder/recording.c2
-rw-r--r--apps/screens.c4
-rw-r--r--apps/screens.h2
-rw-r--r--apps/scrobbler.c10
-rw-r--r--apps/status.c2
17 files changed, 33 insertions, 33 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c
index 24ecd8b051..16dfe59ff2 100644
--- a/apps/gui/gwps-common.c
+++ b/apps/gui/gwps-common.c
@@ -970,7 +970,7 @@ static char* get_tag(struct wps_data* wps_data,
970#endif 970#endif
971 } 971 }
972 break; 972 break;
973#ifdef CONFIG_RTC 973#if CONFIG_RTC
974 case 'c': /* Real Time Clock display */ 974 case 'c': /* Real Time Clock display */
975 *flags |= WPS_REFRESH_DYNAMIC; 975 *flags |= WPS_REFRESH_DYNAMIC;
976 { 976 {
diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c
index fbd8943315..e93fc9649e 100644
--- a/apps/gui/statusbar.c
+++ b/apps/gui/statusbar.c
@@ -141,7 +141,7 @@ static void gui_statusbar_led(struct screen * display);
141#ifdef HAVE_RECORDING 141#ifdef HAVE_RECORDING
142static void gui_statusbar_icon_recording_info(struct screen * display); 142static void gui_statusbar_icon_recording_info(struct screen * display);
143#endif 143#endif
144#ifdef CONFIG_RTC 144#if CONFIG_RTC
145static void gui_statusbar_time(struct screen * display, int hour, int minute); 145static void gui_statusbar_time(struct screen * display, int hour, int minute);
146#endif 146#endif
147#endif 147#endif
@@ -238,7 +238,7 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
238 if(!display->has_disk_led) 238 if(!display->has_disk_led)
239 bar->info.led = led_read(HZ/2); /* delay should match polling interval */ 239 bar->info.led = led_read(HZ/2); /* delay should match polling interval */
240#endif 240#endif
241#ifdef CONFIG_RTC 241#if CONFIG_RTC
242 { 242 {
243 struct tm* tm = get_time(); 243 struct tm* tm = get_time();
244 bar->info.hour = tm->tm_hour; 244 bar->info.hour = tm->tm_hour;
@@ -323,7 +323,7 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
323 if (bar->info.keylockremote) 323 if (bar->info.keylockremote)
324 gui_statusbar_icon_lock_remote(display); 324 gui_statusbar_icon_lock_remote(display);
325#endif 325#endif
326#ifdef CONFIG_RTC 326#if CONFIG_RTC
327 gui_statusbar_time(display, bar->info.hour, bar->info.minute); 327 gui_statusbar_time(display, bar->info.hour, bar->info.minute);
328#endif /* CONFIG_RTC */ 328#endif /* CONFIG_RTC */
329#if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD) 329#if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD)
@@ -580,7 +580,7 @@ static void gui_statusbar_led(struct screen * display)
580} 580}
581#endif 581#endif
582 582
583#ifdef CONFIG_RTC 583#if CONFIG_RTC
584/* 584/*
585 * Print time to status bar 585 * Print time to status bar
586 */ 586 */
diff --git a/apps/gui/statusbar.h b/apps/gui/statusbar.h
index 11b8765b77..21f98336d0 100644
--- a/apps/gui/statusbar.h
+++ b/apps/gui/statusbar.h
@@ -33,7 +33,7 @@ struct status_info {
33 int volume; 33 int volume;
34 int playmode; 34 int playmode;
35 int repeat; 35 int repeat;
36#ifdef CONFIG_RTC 36#if CONFIG_RTC
37 int hour; 37 int hour;
38 int minute; 38 int minute;
39#endif 39#endif
diff --git a/apps/main.c b/apps/main.c
index 916720a5d3..c1f818be7f 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -341,7 +341,7 @@ static void init(void)
341 341
342 i2c_init(); 342 i2c_init();
343 343
344#ifdef CONFIG_RTC 344#if CONFIG_RTC
345 rtc_init(); 345 rtc_init();
346#endif 346#endif
347#ifdef HAVE_RTC_RAM 347#ifdef HAVE_RTC_RAM
diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c
index 2e034162e5..bd7b35dea2 100644
--- a/apps/menus/main_menu.c
+++ b/apps/menus/main_menu.c
@@ -199,7 +199,7 @@ static bool show_info(void)
199 output_dyn_value(NULL, 0, free, kbyte_units, true); 199 output_dyn_value(NULL, 0, free, kbyte_units, true);
200#endif 200#endif
201 201
202#ifdef CONFIG_RTC 202#if CONFIG_RTC
203 { 203 {
204 struct tm* tm = get_time(); 204 struct tm* tm = get_time();
205 talk_id(VOICE_CURRENT_TIME, true); 205 talk_id(VOICE_CURRENT_TIME, true);
diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c
index 27d44fd1cf..d150aac148 100644
--- a/apps/menus/settings_menu.c
+++ b/apps/menus/settings_menu.c
@@ -185,7 +185,7 @@ MAKE_MENU(disk_menu, ID2P(LANG_DISK_MENU), 0, Icon_NOICON,
185#endif 185#endif
186 186
187/* Time & Date */ 187/* Time & Date */
188#ifdef CONFIG_RTC 188#if CONFIG_RTC
189static int timedate_set(void) 189static int timedate_set(void)
190{ 190{
191 struct tm tm; 191 struct tm tm;
@@ -317,7 +317,7 @@ MAKE_MENU(system_menu, ID2P(LANG_SYSTEM),
317#ifndef HAVE_MMC 317#ifndef HAVE_MMC
318 &disk_menu, 318 &disk_menu,
319#endif 319#endif
320#ifdef CONFIG_RTC 320#if CONFIG_RTC
321 &time_menu, 321 &time_menu,
322#endif 322#endif
323 &poweroff, 323 &poweroff,
diff --git a/apps/misc.c b/apps/misc.c
index 57599de456..d4be4dd72d 100644
--- a/apps/misc.c
+++ b/apps/misc.c
@@ -207,7 +207,7 @@ void format_time(char* buf, int buf_size, long t)
207 } 207 }
208} 208}
209 209
210#ifdef CONFIG_RTC 210#if CONFIG_RTC
211/* Create a filename with a date+time part. 211/* Create a filename with a date+time part.
212 It is allowed that buffer and path point to the same memory location, 212 It is allowed that buffer and path point to the same memory location,
213 saving a strcpy(). Path must always be given without trailing slash. 213 saving a strcpy(). Path must always be given without trailing slash.
@@ -413,7 +413,7 @@ void screen_dump(void)
413 static unsigned short line_block[BMP_LINESIZE/2]; 413 static unsigned short line_block[BMP_LINESIZE/2];
414#endif 414#endif
415 415
416#ifdef CONFIG_RTC 416#if CONFIG_RTC
417 create_datetime_filename(filename, "", "dump ", ".bmp", false); 417 create_datetime_filename(filename, "", "dump ", ".bmp", false);
418#else 418#else
419 create_numbered_filename(filename, "", "dump_", ".bmp", 4 419 create_numbered_filename(filename, "", "dump_", ".bmp", 4
diff --git a/apps/misc.h b/apps/misc.h
index f127d6acbf..02a4bd822c 100644
--- a/apps/misc.h
+++ b/apps/misc.h
@@ -38,7 +38,7 @@ char *output_dyn_value(char *buf, int buf_size, int value,
38 * less than zero to number automatically. The final number used will also 38 * less than zero to number automatically. The final number used will also
39 * be returned in *num. If *num is >= 0 then *num will be incremented by 39 * be returned in *num. If *num is >= 0 then *num will be incremented by
40 * one. */ 40 * one. */
41#if CONFIG_CODEC == SWCODEC && defined(HAVE_RECORDING) && !defined(CONFIG_RTC) 41#if CONFIG_CODEC == SWCODEC && defined(HAVE_RECORDING) && (CONFIG_RTC == 0)
42/* this feature is needed by SWCODEC recording without a RTC to prevent 42/* this feature is needed by SWCODEC recording without a RTC to prevent
43 disk access when changing files */ 43 disk access when changing files */
44#define IF_CNFN_NUM_(...) __VA_ARGS__ 44#define IF_CNFN_NUM_(...) __VA_ARGS__
@@ -58,7 +58,7 @@ char *create_numbered_filename(char *buffer, const char *path,
58 */ 58 */
59void format_time(char* buf, int buf_size, long t); 59void format_time(char* buf, int buf_size, long t);
60 60
61#ifdef CONFIG_RTC 61#if CONFIG_RTC
62/* Create a filename with a date+time part. 62/* Create a filename with a date+time part.
63 It is allowed that buffer and path point to the same memory location, 63 It is allowed that buffer and path point to the same memory location,
64 saving a strcpy(). Path must always be given without trailing slash. 64 saving a strcpy(). Path must always be given without trailing slash.
diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES
index 56f845a6dd..b5ec302c23 100644
--- a/apps/plugins/SOURCES
+++ b/apps/plugins/SOURCES
@@ -76,7 +76,7 @@ video.c
76vu_meter.c 76vu_meter.c
77wormlet.c 77wormlet.c
78 78
79#ifdef CONFIG_RTC 79#if CONFIG_RTC
80clock.c 80clock.c
81#if CONFIG_KEYPAD == RECORDER_PAD /* Recorder models only for now */ 81#if CONFIG_KEYPAD == RECORDER_PAD /* Recorder models only for now */
82calendar.c 82calendar.c
diff --git a/apps/plugins/bounce.c b/apps/plugins/bounce.c
index 46d9d88b21..c5c9dad83c 100644
--- a/apps/plugins/bounce.c
+++ b/apps/plugins/bounce.c
@@ -271,7 +271,7 @@ struct counter values[]={
271 {"ydist", -6}, 271 {"ydist", -6},
272}; 272};
273 273
274#ifdef CONFIG_RTC 274#if CONFIG_RTC
275 275
276#define CLOCK_STEP (0xffffffff/60) 276#define CLOCK_STEP (0xffffffff/60)
277#define CLOCK_FRAC (0xffffffff%60) 277#define CLOCK_FRAC (0xffffffff%60)
@@ -382,7 +382,7 @@ static int scrollit(void)
382 return -1; 382 return -1;
383 } 383 }
384 rb->lcd_clear_display(); 384 rb->lcd_clear_display();
385#ifdef CONFIG_RTC 385#if CONFIG_RTC
386 addclock(); 386 addclock();
387#endif 387#endif
388 388
@@ -451,7 +451,7 @@ static int loopit(void)
451 x+= speed[xsanke&15] + values[NUM_XADD].num; 451 x+= speed[xsanke&15] + values[NUM_XADD].num;
452 452
453 rb->lcd_clear_display(); 453 rb->lcd_clear_display();
454#ifdef CONFIG_RTC 454#if CONFIG_RTC
455 addclock(); 455 addclock();
456#endif 456#endif
457 if(timeout) { 457 if(timeout) {
@@ -516,7 +516,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
516 rb->sleep(HZ); 516 rb->sleep(HZ);
517 rb->lcd_set_drawmode(DRMODE_FG); 517 rb->lcd_set_drawmode(DRMODE_FG);
518 init_tables(); 518 init_tables();
519#ifdef CONFIG_RTC 519#if CONFIG_RTC
520 init_clock(); 520 init_clock();
521#endif 521#endif
522 522
diff --git a/apps/plugins/calendar.c b/apps/plugins/calendar.c
index 34af4746a9..8c0b6af5b9 100644
--- a/apps/plugins/calendar.c
+++ b/apps/plugins/calendar.c
@@ -19,7 +19,7 @@
19 ****************************************************************************/ 19 ****************************************************************************/
20#include "plugin.h" 20#include "plugin.h"
21 21
22#if defined(HAVE_LCD_BITMAP) && defined(CONFIG_RTC) 22#if defined(HAVE_LCD_BITMAP) && (CONFIG_RTC != 0)
23 23
24#include <timefuncs.h> 24#include <timefuncs.h>
25 25
@@ -71,7 +71,7 @@ static int calc_weekday( struct shown *shown )
71static void calendar_init(struct today *today, struct shown *shown) 71static void calendar_init(struct today *today, struct shown *shown)
72{ 72{
73 int w,h; 73 int w,h;
74#ifdef CONFIG_RTC 74#if CONFIG_RTC
75 struct tm *tm; 75 struct tm *tm;
76#else 76#else
77 (void)today; 77 (void)today;
@@ -83,7 +83,7 @@ static void calendar_init(struct today *today, struct shown *shown)
83 use_system_font = true; 83 use_system_font = true;
84 } 84 }
85 rb->lcd_clear_display(); 85 rb->lcd_clear_display();
86#ifdef CONFIG_RTC 86#if CONFIG_RTC
87 tm = rb->get_time(); 87 tm = rb->get_time();
88 today->mon = tm->tm_mon +1; 88 today->mon = tm->tm_mon +1;
89 today->year = 2000+tm->tm_year%100; 89 today->year = 2000+tm->tm_year%100;
diff --git a/apps/recorder/icons.h b/apps/recorder/icons.h
index 7b1d69de1b..7682d44733 100644
--- a/apps/recorder/icons.h
+++ b/apps/recorder/icons.h
@@ -177,7 +177,7 @@ extern void statusbar_icon_play_state(int state);
177extern void statusbar_icon_play_mode(int mode); 177extern void statusbar_icon_play_mode(int mode);
178extern void statusbar_icon_shuffle(void); 178extern void statusbar_icon_shuffle(void);
179extern void statusbar_icon_lock(void); 179extern void statusbar_icon_lock(void);
180#ifdef CONFIG_RTC 180#if CONFIG_RTC
181extern void statusbar_time(int hour, int minute); 181extern void statusbar_time(int hour, int minute);
182#endif 182#endif
183#if (CONFIG_LED == LED_VIRTUAL) 183#if (CONFIG_LED == LED_VIRTUAL)
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c
index ffde856612..025480cf91 100644
--- a/apps/recorder/recording.c
+++ b/apps/recorder/recording.c
@@ -518,7 +518,7 @@ char *rec_create_filename(char *buffer)
518 snprintf(ext, sizeof(ext), ".%s", 518 snprintf(ext, sizeof(ext), ".%s",
519 REC_FILE_ENDING(global_settings.rec_format)); 519 REC_FILE_ENDING(global_settings.rec_format));
520 520
521#ifdef CONFIG_RTC 521#if CONFIG_RTC
522 /* We'll wait at least up to the start of the next second so no duplicate 522 /* We'll wait at least up to the start of the next second so no duplicate
523 names are created */ 523 names are created */
524 return create_datetime_filename(buffer, buffer, "R", ext, true); 524 return create_datetime_filename(buffer, buffer, "R", ext, true);
diff --git a/apps/screens.c b/apps/screens.c
index b078f735af..df1d59109b 100644
--- a/apps/screens.c
+++ b/apps/screens.c
@@ -784,7 +784,7 @@ void charging_splash(void)
784#endif 784#endif
785 785
786 786
787#if defined(HAVE_LCD_BITMAP) && defined (CONFIG_RTC) 787#if defined(HAVE_LCD_BITMAP) && (CONFIG_RTC != 0)
788 788
789const int dayname[] = { 789const int dayname[] = {
790 LANG_WEEKDAY_SUNDAY, 790 LANG_WEEKDAY_SUNDAY,
@@ -1081,7 +1081,7 @@ bool set_time_screen(const char* string, struct tm *tm)
1081 lcd_set_drawmode(lastmode); 1081 lcd_set_drawmode(lastmode);
1082 return false; 1082 return false;
1083} 1083}
1084#endif /* defined(HAVE_LCD_BITMAP) && defined (CONFIG_RTC) */ 1084#endif /* defined(HAVE_LCD_BITMAP) && (CONFIG_RTC != 0) */
1085 1085
1086#if (CONFIG_KEYPAD == RECORDER_PAD) && !defined(HAVE_SW_POWEROFF) 1086#if (CONFIG_KEYPAD == RECORDER_PAD) && !defined(HAVE_SW_POWEROFF)
1087bool shutdown_screen(void) 1087bool shutdown_screen(void)
diff --git a/apps/screens.h b/apps/screens.h
index 3015652a5c..ce174e1e58 100644
--- a/apps/screens.h
+++ b/apps/screens.h
@@ -42,7 +42,7 @@ extern bool quick_screen_f3(int button_enter);
42#endif 42#endif
43extern bool quick_screen_quick(int button_enter); 43extern bool quick_screen_quick(int button_enter);
44 44
45#ifdef CONFIG_RTC 45#if CONFIG_RTC
46bool set_time_screen(const char* string, struct tm *tm); 46bool set_time_screen(const char* string, struct tm *tm);
47#endif 47#endif
48 48
diff --git a/apps/scrobbler.c b/apps/scrobbler.c
index a339429cab..07ba016a51 100644
--- a/apps/scrobbler.c
+++ b/apps/scrobbler.c
@@ -32,7 +32,7 @@ http://www.audioscrobbler.net/wiki/Portable_Player_Logging
32#include "settings.h" 32#include "settings.h"
33#include "ata_idle_notify.h" 33#include "ata_idle_notify.h"
34 34
35#ifdef CONFIG_RTC 35#if CONFIG_RTC
36#include "time.h" 36#include "time.h"
37#include "timefuncs.h" 37#include "timefuncs.h"
38#endif 38#endif
@@ -41,7 +41,7 @@ http://www.audioscrobbler.net/wiki/Portable_Player_Logging
41 41
42#define SCROBBLER_VERSION "1.0" 42#define SCROBBLER_VERSION "1.0"
43 43
44#ifdef CONFIG_RTC 44#if CONFIG_RTC
45#define SCROBBLER_FILE "/.scrobbler.log" 45#define SCROBBLER_FILE "/.scrobbler.log"
46#else 46#else
47#define SCROBBLER_FILE "/.scrobbler-timeless.log" 47#define SCROBBLER_FILE "/.scrobbler-timeless.log"
@@ -62,7 +62,7 @@ static struct mp3entry scrobbler_entry;
62static bool pending = false; 62static bool pending = false;
63static bool scrobbler_initialised = false; 63static bool scrobbler_initialised = false;
64static bool scrobbler_ata_callback = false; 64static bool scrobbler_ata_callback = false;
65#ifdef CONFIG_RTC 65#if CONFIG_RTC
66static time_t timestamp; 66static time_t timestamp;
67#else 67#else
68static unsigned long timestamp; 68static unsigned long timestamp;
@@ -92,7 +92,7 @@ static void write_cache(void)
92 { 92 {
93 fdprintf(scrobbler_fd, "#AUDIOSCROBBLER/%s\n", SCROBBLER_VERSION); 93 fdprintf(scrobbler_fd, "#AUDIOSCROBBLER/%s\n", SCROBBLER_VERSION);
94 fdprintf(scrobbler_fd, "#TZ/UNKNOWN\n"); 94 fdprintf(scrobbler_fd, "#TZ/UNKNOWN\n");
95#ifdef CONFIG_RTC 95#if CONFIG_RTC
96 fdprintf(scrobbler_fd, 96 fdprintf(scrobbler_fd,
97 "#CLIENT/Rockbox " TARGET_NAME SCROBBLER_REVISION "\n"); 97 "#CLIENT/Rockbox " TARGET_NAME SCROBBLER_REVISION "\n");
98#else 98#else
@@ -207,7 +207,7 @@ void scrobbler_change_event(struct mp3entry *id)
207 { 207 {
208 logf("SCROBBLER: add pending"); 208 logf("SCROBBLER: add pending");
209 copy_mp3entry(&scrobbler_entry, id); 209 copy_mp3entry(&scrobbler_entry, id);
210#ifdef CONFIG_RTC 210#if CONFIG_RTC
211 timestamp = mktime(get_time()); 211 timestamp = mktime(get_time());
212#else 212#else
213 timestamp = 0; 213 timestamp = 0;
diff --git a/apps/status.c b/apps/status.c
index 1551f77d53..468ca19c13 100644
--- a/apps/status.c
+++ b/apps/status.c
@@ -29,7 +29,7 @@
29#include "gwps.h" 29#include "gwps.h"
30#include "abrepeat.h" 30#include "abrepeat.h"
31#include "statusbar.h" 31#include "statusbar.h"
32#ifdef CONFIG_RTC 32#if CONFIG_RTC
33#include "timefuncs.h" 33#include "timefuncs.h"
34#endif 34#endif
35#ifdef HAVE_LCD_BITMAP 35#ifdef HAVE_LCD_BITMAP