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.zip
rockbox-2c7b127dd77564a8ca8c384d7d1abed441efe110.tar.gz
rockbox-2c7b127dd77564a8ca8c384d7d1abed441efe110.tar.bz2
rockbox-2c7b127dd77564a8ca8c384d7d1abed441efe110.tar.xz
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 24ecd8b..16dfe59 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,
#endif
}
break;
-#ifdef CONFIG_RTC
+#if CONFIG_RTC
case 'c': /* Real Time Clock display */
*flags |= WPS_REFRESH_DYNAMIC;
{
diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c
index fbd8943..e93fc96 100644
--- a/apps/gui/statusbar.c
+++ b/apps/gui/statusbar.c
@@ -141,7 +141,7 @@ static void gui_statusbar_led(struct screen * display);
#ifdef HAVE_RECORDING
static void gui_statusbar_icon_recording_info(struct screen * display);
#endif
-#ifdef CONFIG_RTC
+#if CONFIG_RTC
static void gui_statusbar_time(struct screen * display, int hour, int minute);
#endif
#endif
@@ -238,7 +238,7 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
if(!display->has_disk_led)
bar->info.led = led_read(HZ/2); /* delay should match polling interval */
#endif
-#ifdef CONFIG_RTC
+#if CONFIG_RTC
{
struct tm* tm = get_time();
bar->info.hour = tm->tm_hour;
@@ -323,7 +323,7 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
if (bar->info.keylockremote)
gui_statusbar_icon_lock_remote(display);
#endif
-#ifdef CONFIG_RTC
+#if CONFIG_RTC
gui_statusbar_time(display, bar->info.hour, bar->info.minute);
#endif /* CONFIG_RTC */
#if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD)
@@ -580,7 +580,7 @@ static void gui_statusbar_led(struct screen * display)
}
#endif
-#ifdef CONFIG_RTC
+#if CONFIG_RTC
/*
* Print time to status bar
*/
diff --git a/apps/gui/statusbar.h b/apps/gui/statusbar.h
index 11b8765..21f9833 100644
--- a/apps/gui/statusbar.h
+++ b/apps/gui/statusbar.h
@@ -33,7 +33,7 @@ struct status_info {
int volume;
int playmode;
int repeat;
-#ifdef CONFIG_RTC
+#if CONFIG_RTC
int hour;
int minute;
#endif
diff --git a/apps/main.c b/apps/main.c
index 916720a..c1f818b 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -341,7 +341,7 @@ static void init(void)
i2c_init();
-#ifdef CONFIG_RTC
+#if CONFIG_RTC
rtc_init();
#endif
#ifdef HAVE_RTC_RAM
diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c
index 2e03416..bd7b35d 100644
--- a/apps/menus/main_menu.c
+++ b/apps/menus/main_menu.c
@@ -199,7 +199,7 @@ static bool show_info(void)
output_dyn_value(NULL, 0, free, kbyte_units, true);
#endif
-#ifdef CONFIG_RTC
+#if CONFIG_RTC
{
struct tm* tm = get_time();
talk_id(VOICE_CURRENT_TIME, true);
diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c
index 27d44fd..d150aac 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,
#endif
/* Time & Date */
-#ifdef CONFIG_RTC
+#if CONFIG_RTC
static int timedate_set(void)
{
struct tm tm;
@@ -317,7 +317,7 @@ MAKE_MENU(system_menu, ID2P(LANG_SYSTEM),
#ifndef HAVE_MMC
&disk_menu,
#endif
-#ifdef CONFIG_RTC
+#if CONFIG_RTC
&time_menu,
#endif
&poweroff,
diff --git a/apps/misc.c b/apps/misc.c
index 57599de..d4be4dd 100644
--- a/apps/misc.c
+++ b/apps/misc.c
@@ -207,7 +207,7 @@ void format_time(char* buf, int buf_size, long t)
}
}
-#ifdef CONFIG_RTC
+#if CONFIG_RTC
/* Create a filename with a date+time part.
It is allowed that buffer and path point to the same memory location,
saving a strcpy(). Path must always be given without trailing slash.
@@ -413,7 +413,7 @@ void screen_dump(void)
static unsigned short line_block[BMP_LINESIZE/2];
#endif
-#ifdef CONFIG_RTC
+#if CONFIG_RTC
create_datetime_filename(filename, "", "dump ", ".bmp", false);
#else
create_numbered_filename(filename, "", "dump_", ".bmp", 4
diff --git a/apps/misc.h b/apps/misc.h
index f127d6a..02a4bd8 100644
--- a/apps/misc.h
+++ b/apps/misc.h
@@ -38,7 +38,7 @@ char *output_dyn_value(char *buf, int buf_size, int value,
* less than zero to number automatically. The final number used will also
* be returned in *num. If *num is >= 0 then *num will be incremented by
* one. */
-#if CONFIG_CODEC == SWCODEC && defined(HAVE_RECORDING) && !defined(CONFIG_RTC)
+#if CONFIG_CODEC == SWCODEC && defined(HAVE_RECORDING) && (CONFIG_RTC == 0)
/* this feature is needed by SWCODEC recording without a RTC to prevent
disk access when changing files */
#define IF_CNFN_NUM_(...) __VA_ARGS__
@@ -58,7 +58,7 @@ char *create_numbered_filename(char *buffer, const char *path,
*/
void format_time(char* buf, int buf_size, long t);
-#ifdef CONFIG_RTC
+#if CONFIG_RTC
/* Create a filename with a date+time part.
It is allowed that buffer and path point to the same memory location,
saving a strcpy(). Path must always be given without trailing slash.
diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES
index 56f845a..b5ec302 100644
--- a/apps/plugins/SOURCES
+++ b/apps/plugins/SOURCES
@@ -76,7 +76,7 @@ video.c
vu_meter.c
wormlet.c
-#ifdef CONFIG_RTC
+#if CONFIG_RTC
clock.c
#if CONFIG_KEYPAD == RECORDER_PAD /* Recorder models only for now */
calendar.c
diff --git a/apps/plugins/bounce.c b/apps/plugins/bounce.c
index 46d9d88..c5c9dad 100644
--- a/apps/plugins/bounce.c
+++ b/apps/plugins/bounce.c
@@ -271,7 +271,7 @@ struct counter values[]={
{"ydist", -6},
};
-#ifdef CONFIG_RTC
+#if CONFIG_RTC
#define CLOCK_STEP (0xffffffff/60)
#define CLOCK_FRAC (0xffffffff%60)
@@ -382,7 +382,7 @@ static int scrollit(void)
return -1;
}
rb->lcd_clear_display();
-#ifdef CONFIG_RTC
+#if CONFIG_RTC
addclock();
#endif
@@ -451,7 +451,7 @@ static int loopit(void)
x+= speed[xsanke&15] + values[NUM_XADD].num;
rb->lcd_clear_display();
-#ifdef CONFIG_RTC
+#if CONFIG_RTC
addclock();
#endif
if(timeout) {
@@ -516,7 +516,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
rb->sleep(HZ);
rb->lcd_set_drawmode(DRMODE_FG);
init_tables();
-#ifdef CONFIG_RTC
+#if CONFIG_RTC
init_clock();
#endif
diff --git a/apps/plugins/calendar.c b/apps/plugins/calendar.c
index 34af474..8c0b6af 100644
--- a/apps/plugins/calendar.c
+++ b/apps/plugins/calendar.c
@@ -19,7 +19,7 @@
****************************************************************************/
#include "plugin.h"
-#if defined(HAVE_LCD_BITMAP) && defined(CONFIG_RTC)
+#if defined(HAVE_LCD_BITMAP) && (CONFIG_RTC != 0)
#include <timefuncs.h>
@@ -71,7 +71,7 @@ static int calc_weekday( struct shown *shown )
static void calendar_init(struct today *today, struct shown *shown)
{
int w,h;
-#ifdef CONFIG_RTC
+#if CONFIG_RTC
struct tm *tm;
#else
(void)today;
@@ -83,7 +83,7 @@ static void calendar_init(struct today *today, struct shown *shown)
use_system_font = true;
}
rb->lcd_clear_display();
-#ifdef CONFIG_RTC
+#if CONFIG_RTC
tm = rb->get_time();
today->mon = tm->tm_mon +1;
today->year = 2000+tm->tm_year%100;
diff --git a/apps/recorder/icons.h b/apps/recorder/icons.h
index 7b1d69d..7682d44 100644
--- a/apps/recorder/icons.h
+++ b/apps/recorder/icons.h
@@ -177,7 +177,7 @@ extern void statusbar_icon_play_state(int state);
extern void statusbar_icon_play_mode(int mode);
extern void statusbar_icon_shuffle(void);
extern void statusbar_icon_lock(void);
-#ifdef CONFIG_RTC
+#if CONFIG_RTC
extern void statusbar_time(int hour, int minute);
#endif
#if (CONFIG_LED == LED_VIRTUAL)
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c
index ffde856..025480c 100644
--- a/apps/recorder/recording.c
+++ b/apps/recorder/recording.c
@@ -518,7 +518,7 @@ char *rec_create_filename(char *buffer)
snprintf(ext, sizeof(ext), ".%s",
REC_FILE_ENDING(global_settings.rec_format));
-#ifdef CONFIG_RTC
+#if CONFIG_RTC
/* We'll wait at least up to the start of the next second so no duplicate
names are created */
return create_datetime_filename(buffer, buffer, "R", ext, true);
diff --git a/apps/screens.c b/apps/screens.c
index b078f73..df1d591 100644
--- a/apps/screens.c
+++ b/apps/screens.c
@@ -784,7 +784,7 @@ void charging_splash(void)
#endif
-#if defined(HAVE_LCD_BITMAP) && defined (CONFIG_RTC)
+#if defined(HAVE_LCD_BITMAP) && (CONFIG_RTC != 0)
const int dayname[] = {
LANG_WEEKDAY_SUNDAY,
@@ -1081,7 +1081,7 @@ bool set_time_screen(const char* string, struct tm *tm)
lcd_set_drawmode(lastmode);
return false;
}
-#endif /* defined(HAVE_LCD_BITMAP) && defined (CONFIG_RTC) */
+#endif /* defined(HAVE_LCD_BITMAP) && (CONFIG_RTC != 0) */
#if (CONFIG_KEYPAD == RECORDER_PAD) && !defined(HAVE_SW_POWEROFF)
bool shutdown_screen(void)
diff --git a/apps/screens.h b/apps/screens.h
index 3015652..ce174e1 100644
--- a/apps/screens.h
+++ b/apps/screens.h
@@ -42,7 +42,7 @@ extern bool quick_screen_f3(int button_enter);
#endif
extern bool quick_screen_quick(int button_enter);
-#ifdef CONFIG_RTC
+#if CONFIG_RTC
bool set_time_screen(const char* string, struct tm *tm);
#endif
diff --git a/apps/scrobbler.c b/apps/scrobbler.c
index a339429..07ba016 100644
--- a/apps/scrobbler.c
+++ b/apps/scrobbler.c
@@ -32,7 +32,7 @@ http://www.audioscrobbler.net/wiki/Portable_Player_Logging
#include "settings.h"
#include "ata_idle_notify.h"
-#ifdef CONFIG_RTC
+#if CONFIG_RTC
#include "time.h"
#include "timefuncs.h"
#endif
@@ -41,7 +41,7 @@ http://www.audioscrobbler.net/wiki/Portable_Player_Logging
#define SCROBBLER_VERSION "1.0"
-#ifdef CONFIG_RTC
+#if CONFIG_RTC
#define SCROBBLER_FILE "/.scrobbler.log"
#else
#define SCROBBLER_FILE "/.scrobbler-timeless.log"
@@ -62,7 +62,7 @@ static struct mp3entry scrobbler_entry;
static bool pending = false;
static bool scrobbler_initialised = false;
static bool scrobbler_ata_callback = false;
-#ifdef CONFIG_RTC
+#if CONFIG_RTC
static time_t timestamp;
#else
static unsigned long timestamp;
@@ -92,7 +92,7 @@ static void write_cache(void)
{
fdprintf(scrobbler_fd, "#AUDIOSCROBBLER/%s\n", SCROBBLER_VERSION);
fdprintf(scrobbler_fd, "#TZ/UNKNOWN\n");
-#ifdef CONFIG_RTC
+#if CONFIG_RTC
fdprintf(scrobbler_fd,
"#CLIENT/Rockbox " TARGET_NAME SCROBBLER_REVISION "\n");
#else
@@ -207,7 +207,7 @@ void scrobbler_change_event(struct mp3entry *id)
{
logf("SCROBBLER: add pending");
copy_mp3entry(&scrobbler_entry, id);
-#ifdef CONFIG_RTC
+#if CONFIG_RTC
timestamp = mktime(get_time());
#else
timestamp = 0;
diff --git a/apps/status.c b/apps/status.c
index 1551f77..468ca19 100644
--- a/apps/status.c
+++ b/apps/status.c
@@ -29,7 +29,7 @@
#include "gwps.h"
#include "abrepeat.h"
#include "statusbar.h"
-#ifdef CONFIG_RTC
+#if CONFIG_RTC
#include "timefuncs.h"
#endif
#ifdef HAVE_LCD_BITMAP