From 8c800cf59af23eaa22b97e89556640f63998b9bd Mon Sep 17 00:00:00 2001 From: Dave Chapman Date: Sun, 4 Dec 2005 15:23:47 +0000 Subject: Replace references to HAVE_RTC with CONFIG_RTC and remove the HAVE_RTC defines from config-*.h git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8147 a1c6a512-1295-4272-9138-f99709370657 --- apps/debug_menu.h | 2 +- apps/gui/statusbar.c | 14 +++++++------- apps/gui/statusbar.h | 4 ++-- apps/main.c | 2 +- apps/main_menu.c | 2 +- apps/misc.c | 6 +++--- apps/misc.h | 2 +- apps/plugins/SOURCES | 4 ++-- apps/plugins/battery_test.c | 2 +- apps/plugins/bounce.c | 8 ++++---- apps/plugins/calendar.c | 6 +++--- apps/plugins/clock.c | 2 +- apps/recorder/icons.h | 2 +- apps/recorder/recording.c | 2 +- apps/screens.c | 4 ++-- apps/screens.h | 2 +- apps/settings_menu.c | 6 +++--- apps/status.c | 2 +- firmware/SOURCES | 2 -- firmware/common/timefuncs.c | 4 ++-- firmware/drivers/fat.c | 6 +++--- firmware/drivers/rtc.c | 2 +- firmware/export/config-fmrecorder.h | 5 +---- firmware/export/config-gmini120.h | 5 +---- firmware/export/config-recorder.h | 5 +---- firmware/export/config-recorderv2.h | 5 +---- firmware/export/rtc.h | 4 ++-- 27 files changed, 48 insertions(+), 62 deletions(-) diff --git a/apps/debug_menu.h b/apps/debug_menu.h index 4b2c193662..e3f2eb4ebd 100644 --- a/apps/debug_menu.h +++ b/apps/debug_menu.h @@ -23,7 +23,7 @@ bool debug_menu(void); #ifndef SIMULATOR extern bool dbg_ports(void); -#ifdef HAVE_RTC +#ifdef CONFIG_RTC extern bool dbg_rtc(void); #endif #endif diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c index d336d8ad0e..fda54a610e 100644 --- a/apps/gui/statusbar.c +++ b/apps/gui/statusbar.c @@ -112,9 +112,9 @@ void gui_statusbar_init(struct gui_statusbar * bar) void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw) { struct screen * display = bar->display; -#ifdef HAVE_RTC +#ifdef CONFIG_RTC struct tm* tm; /* For Time */ -#endif /* HAVE_RTC */ +#endif /* CONFIG_RTC */ #ifdef HAVE_LCD_CHARCELLS (void)force_redraw; /* players always "redraw" */ @@ -126,11 +126,11 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw) bar->info.battery_safe = battery_level_safe(); #ifdef HAVE_LCD_BITMAP -#ifdef HAVE_RTC +#ifdef CONFIG_RTC tm = get_time(); bar->info.hour = tm->tm_hour; bar->info.minute = tm->tm_min; -#endif /* HAVE_RTC */ +#endif /* CONFIG_RTC */ bar->info.shuffle = global_settings.playlist_shuffle; #ifdef HAS_BUTTON_HOLD @@ -257,9 +257,9 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw) if (bar->info.keylockremote) gui_statusbar_icon_lock_remote(display); #endif -#ifdef HAVE_RTC +#ifdef CONFIG_RTC gui_statusbar_time(display, bar->info.hour, bar->info.minute); -#endif /* HAVE_RTC */ +#endif /* CONFIG_RTC */ #if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD) if(!display->has_disk_led && bar->info.led) gui_statusbar_led(display); @@ -482,7 +482,7 @@ void gui_statusbar_led(struct screen * display) } #endif -#ifdef HAVE_RTC +#ifdef CONFIG_RTC /* * Print time to status bar */ diff --git a/apps/gui/statusbar.h b/apps/gui/statusbar.h index 62f6b90820..6b8e49a838 100644 --- a/apps/gui/statusbar.h +++ b/apps/gui/statusbar.h @@ -32,7 +32,7 @@ struct status_info { int battlevel; int volume; -#ifdef HAVE_RTC +#ifdef CONFIG_RTC int hour; int minute; #endif @@ -111,7 +111,7 @@ void gui_statusbar_icon_lock_remote(struct screen * display); void gui_statusbar_led(struct screen * display); -#ifdef HAVE_RTC +#ifdef CONFIG_RTC void gui_statusbar_time(struct screen * display, int hour, int minute); #endif diff --git a/apps/main.c b/apps/main.c index 94d6f70577..a0cab20dd7 100644 --- a/apps/main.c +++ b/apps/main.c @@ -226,7 +226,7 @@ void init(void) i2c_init(); -#ifdef HAVE_RTC +#ifdef CONFIG_RTC rtc_init(); #endif #ifdef HAVE_RTC_RAM diff --git a/apps/main_menu.c b/apps/main_menu.c index 262dd61a20..8bdb6fec2e 100644 --- a/apps/main_menu.c +++ b/apps/main_menu.c @@ -125,7 +125,7 @@ bool show_info(void) output_dyn_value(NULL, 0, free, kbyte_units, true); /* NULL == talk */ #endif -#ifdef HAVE_RTC +#ifdef CONFIG_RTC { struct tm* tm = get_time(); talk_id(VOICE_CURRENT_TIME, true); diff --git a/apps/misc.c b/apps/misc.c index 6f55b6f6b5..c40eac0def 100644 --- a/apps/misc.c +++ b/apps/misc.c @@ -154,7 +154,7 @@ char *create_numbered_filename(char *buffer, const char *path, return buffer; } -#ifdef HAVE_RTC +#ifdef 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. */ @@ -175,7 +175,7 @@ char *create_datetime_filename(char *buffer, const char *path, return buffer; } -#endif /* HAVE_RTC */ +#endif /* CONFIG_RTC */ /* Read (up to) a line of text from fd into buffer and return number of bytes * read (which may be larger than the number of bytes stored in buffer). If @@ -300,7 +300,7 @@ void screen_dump(void) static unsigned short line_block[BMP_LINESIZE/2]; #endif -#ifdef HAVE_RTC +#ifdef CONFIG_RTC create_datetime_filename(filename, "", "dump ", ".bmp"); #else create_numbered_filename(filename, "", "dump_", ".bmp", 4); diff --git a/apps/misc.h b/apps/misc.h index 5af2568f7b..c5a89901ee 100644 --- a/apps/misc.h +++ b/apps/misc.h @@ -30,7 +30,7 @@ void output_dyn_value(char *buf, int buf_size, int value, char *create_numbered_filename(char *buffer, const char *path, const char *prefix, const char *suffix, int numberlen); -#ifdef HAVE_RTC +#ifdef CONFIG_RTC char *create_datetime_filename(char *buffer, const char *path, const char *prefix, const char *suffix); #endif diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES index b335a068f4..c2ddc3d42b 100644 --- a/apps/plugins/SOURCES +++ b/apps/plugins/SOURCES @@ -56,10 +56,10 @@ video.c #endif vu_meter.c -#ifdef HAVE_RTC /* Recorder models only */ +#ifdef CONFIG_RTC /* Recorder models only */ calendar.c clock.c -#endif /* #ifdef HAVE_RTC */ +#endif /* #ifdef CONFIG_RTC */ #if CONFIG_KEYPAD != ONDIO_PAD /* gradually bring in the ones not working yet */ diff --git a/apps/plugins/battery_test.c b/apps/plugins/battery_test.c index adb1a2d86e..31ae801934 100644 --- a/apps/plugins/battery_test.c +++ b/apps/plugins/battery_test.c @@ -87,7 +87,7 @@ enum plugin_status loop(void) rb->splash(HZ, true, "Failed creating /battery.log"); break; } -#ifdef HAVE_RTC +#ifdef CONFIG_RTC t = rb->get_time(); #else { diff --git a/apps/plugins/bounce.c b/apps/plugins/bounce.c index 3a44a4cc46..487965a4cf 100644 --- a/apps/plugins/bounce.c +++ b/apps/plugins/bounce.c @@ -230,7 +230,7 @@ struct counter values[]={ {"ydist", -6}, }; -#ifdef HAVE_RTC +#ifdef CONFIG_RTC static unsigned char yminute[]={ 53,53,52,52,51,50,49,47,46,44,42,40,38,36,34,32,29,27,25,23,21,19,17,16,14,13,12,11,11,10,10,10,11,11,12,13,14,16,17,19,21,23,25,27,29,31,34,36,38,40,42,44,46,47,49,50,51,52,52,53, }; @@ -277,7 +277,7 @@ static void addclock(void) yminute[(i+1)%60]); } } -#endif /* HAVE_RTC */ +#endif /* CONFIG_RTC */ #define DRAW_WIDTH (LCD_WIDTH + LETTER_WIDTH*2) @@ -330,7 +330,7 @@ static int scrollit(void) yy += YADD; xx+= DRAW_WIDTH/LETTERS_ON_SCREEN; } -#ifdef HAVE_RTC +#ifdef CONFIG_RTC addclock(); #endif rb->lcd_update(); @@ -385,7 +385,7 @@ static int loopit(void) x+= speed[xsanke&15] + values[NUM_XADD].num; rb->lcd_clear_display(); -#ifdef HAVE_RTC +#ifdef CONFIG_RTC addclock(); #endif if(timeout) { diff --git a/apps/plugins/calendar.c b/apps/plugins/calendar.c index df23afd721..5cb04b565c 100644 --- a/apps/plugins/calendar.c +++ b/apps/plugins/calendar.c @@ -19,7 +19,7 @@ ****************************************************************************/ #include "plugin.h" -#if defined(HAVE_LCD_BITMAP) && defined(HAVE_RTC) +#if defined(HAVE_LCD_BITMAP) && defined(CONFIG_RTC) #include @@ -69,7 +69,7 @@ static int calc_weekday( struct shown *shown ) static void calendar_init(struct today *today, struct shown *shown) { int w,h; -#ifdef HAVE_RTC +#ifdef CONFIG_RTC struct tm *tm; #else (void)today; @@ -81,7 +81,7 @@ static void calendar_init(struct today *today, struct shown *shown) use_system_font = true; } rb->lcd_clear_display(); -#ifdef HAVE_RTC +#ifdef CONFIG_RTC tm = rb->get_time(); today->mon = tm->tm_mon +1; today->year = 2000+tm->tm_year%100; diff --git a/apps/plugins/clock.c b/apps/plugins/clock.c index 6b06b1a74e..9c940dc7c3 100644 --- a/apps/plugins/clock.c +++ b/apps/plugins/clock.c @@ -78,7 +78,7 @@ Original release, featuring analog / digital modes and a few options. #include "plugin.h" #include "time.h" -#if defined(HAVE_LCD_BITMAP) && defined(HAVE_RTC) +#if defined(HAVE_LCD_BITMAP) && defined(CONFIG_RTC) #define CLOCK_VERSION "2.60" diff --git a/apps/recorder/icons.h b/apps/recorder/icons.h index a21b801cb9..72dc70a95c 100644 --- a/apps/recorder/icons.h +++ b/apps/recorder/icons.h @@ -122,7 +122,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 HAVE_RTC +#ifdef 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 c7da2bbb9f..4ca4bcb925 100644 --- a/apps/recorder/recording.c +++ b/apps/recorder/recording.c @@ -210,7 +210,7 @@ char *rec_create_filename(char *buffer) else strncpy(buffer, rec_base_directory, MAX_PATH); -#ifdef HAVE_RTC +#ifdef CONFIG_RTC create_datetime_filename(buffer, buffer, "R", REC_FILE_ENDING); #else create_numbered_filename(buffer, buffer, "rec_", REC_FILE_ENDING, 4); diff --git a/apps/screens.c b/apps/screens.c index 8bf18dc6c6..d8bfb56500 100644 --- a/apps/screens.c +++ b/apps/screens.c @@ -624,7 +624,7 @@ void charging_splash(void) #endif -#if defined(HAVE_LCD_BITMAP) && defined (HAVE_RTC) +#if defined(HAVE_LCD_BITMAP) && defined (CONFIG_RTC) /* little helper function for voice output */ static void say_time(int cursorpos, const struct tm *tm) @@ -923,7 +923,7 @@ bool set_time_screen(const char* string, struct tm *tm) lcd_set_drawmode(lastmode); return false; } -#endif /* defined(HAVE_LCD_BITMAP) && defined (HAVE_RTC) */ +#endif /* defined(HAVE_LCD_BITMAP) && defined (CONFIG_RTC) */ #if (CONFIG_KEYPAD == RECORDER_PAD) && !defined(HAVE_SW_POWEROFF) bool shutdown_screen(void) diff --git a/apps/screens.h b/apps/screens.h index ea5e9440c8..c8e5c320f5 100644 --- a/apps/screens.h +++ b/apps/screens.h @@ -41,7 +41,7 @@ extern bool quick_screen_f3(int button_enter); #endif extern bool quick_screen_quick(int button_enter); -#ifdef HAVE_RTC +#ifdef CONFIG_RTC bool set_time_screen(const char* string, struct tm *tm); #endif diff --git a/apps/settings_menu.c b/apps/settings_menu.c index 3553c01f09..88b246fec4 100644 --- a/apps/settings_menu.c +++ b/apps/settings_menu.c @@ -829,7 +829,7 @@ static bool battery_type(void) #endif #endif -#ifdef HAVE_RTC +#ifdef CONFIG_RTC static bool timedate_set(void) { struct tm tm; @@ -1682,7 +1682,7 @@ static bool disk_settings_menu(void) } #endif /* !HAVE_MMC */ -#ifdef HAVE_RTC +#ifdef CONFIG_RTC static bool time_settings_menu(void) { int m; @@ -1748,7 +1748,7 @@ static bool system_settings_menu(void) #ifndef HAVE_MMC { ID2P(LANG_DISK_MENU), disk_settings_menu }, #endif -#ifdef HAVE_RTC +#ifdef CONFIG_RTC { ID2P(LANG_TIME_MENU), time_settings_menu }, #endif { ID2P(LANG_POWEROFF_IDLE), poweroff_idle_timer }, diff --git a/apps/status.c b/apps/status.c index 296b7aaf0e..5c5fb3eaa6 100644 --- a/apps/status.c +++ b/apps/status.c @@ -29,7 +29,7 @@ #include "gwps.h" #include "abrepeat.h" #include "statusbar.h" -#ifdef HAVE_RTC +#ifdef CONFIG_RTC #include "timefuncs.h" #endif #ifdef HAVE_LCD_BITMAP diff --git a/firmware/SOURCES b/firmware/SOURCES index 086501cc30..e2e0e44e5d 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES @@ -97,11 +97,9 @@ drivers/mas.c #ifdef IRIVER_H300_SERIES drivers/pcf50606.c #endif -#ifdef HAVE_RTC #if CONFIG_RTC == RTC_M41ST84W drivers/rtc.c #endif -#endif drivers/serial.c #endif /* !SIMULATOR */ #ifdef HAVE_LCD_BITMAP diff --git a/firmware/common/timefuncs.c b/firmware/common/timefuncs.c index 1a256cc05e..c40ff2880c 100644 --- a/firmware/common/timefuncs.c +++ b/firmware/common/timefuncs.c @@ -46,7 +46,7 @@ bool valid_time(const struct tm *tm) struct tm *get_time(void) { #ifndef SIMULATOR -#ifdef HAVE_RTC +#ifdef CONFIG_RTC char rtcbuf[8]; /* We don't need the first byte, but we want the indexes in the @@ -84,7 +84,7 @@ struct tm *get_time(void) int set_time(const struct tm *tm) { -#ifdef HAVE_RTC +#ifdef CONFIG_RTC int rc; int tmp; diff --git a/firmware/drivers/fat.c b/firmware/drivers/fat.c index 758e48cdbd..fd09bff0da 100644 --- a/firmware/drivers/fat.c +++ b/firmware/drivers/fat.c @@ -1010,7 +1010,7 @@ static void fat_time(unsigned short* date, unsigned short* time, unsigned short* tenth ) { -#ifdef HAVE_RTC +#ifdef CONFIG_RTC struct tm* tm = get_time(); if (date) @@ -1092,7 +1092,7 @@ static void fat_time(unsigned short* date, } if (tenth) *tenth = 0; -#endif /* HAVE_RTC */ +#endif /* CONFIG_RTC */ } static int write_long_name(struct fat_file* file, @@ -1529,7 +1529,7 @@ static int update_short_entry( struct fat_file* file, long size, int attr ) *sizeptr = htole32(size); { -#ifdef HAVE_RTC +#ifdef CONFIG_RTC unsigned short time = 0; unsigned short date = 0; #else diff --git a/firmware/drivers/rtc.c b/firmware/drivers/rtc.c index 0e65a8be5b..30bbb6dfcb 100644 --- a/firmware/drivers/rtc.c +++ b/firmware/drivers/rtc.c @@ -17,7 +17,7 @@ * ****************************************************************************/ #include "config.h" -#ifdef HAVE_RTC +#ifdef CONFIG_RTC #include "i2c.h" #include "rtc.h" #include "kernel.h" diff --git a/firmware/export/config-fmrecorder.h b/firmware/export/config-fmrecorder.h index 221472a179..a96da0a352 100644 --- a/firmware/export/config-fmrecorder.h +++ b/firmware/export/config-fmrecorder.h @@ -13,14 +13,11 @@ #define CONFIG_KEYPAD RECORDER_PAD /* define this if you have a real-time clock */ -#define HAVE_RTC 1 +#define CONFIG_RTC RTC_M41ST84W /* define this if you have RTC RAM available for settings */ #define HAVE_RTC_RAM 1 -/* define this to the type of RTC hardware */ -#define CONFIG_RTC RTC_M41ST84W - /* Define this if you have a software controlled poweroff */ #define HAVE_SW_POWEROFF diff --git a/firmware/export/config-gmini120.h b/firmware/export/config-gmini120.h index a7566649b5..29066ecae3 100644 --- a/firmware/export/config-gmini120.h +++ b/firmware/export/config-gmini120.h @@ -8,14 +8,11 @@ #define HAVE_LCD_BITMAP 1 /* define this if you have a real-time clock */ -#define HAVE_RTC 1 +#define CONFIG_RTC RTC_M41ST84W /* define this if you have RTC RAM available for settings */ #define HAVE_RTC_RAM 1 -/* define this to the type of RTC hardware */ -#define CONFIG_RTC RTC_M41ST84W - /* LCD dimensions */ #define LCD_WIDTH 128 #define LCD_HEIGHT 64 diff --git a/firmware/export/config-recorder.h b/firmware/export/config-recorder.h index 97062c168c..fee2b2a2e0 100644 --- a/firmware/export/config-recorder.h +++ b/firmware/export/config-recorder.h @@ -13,14 +13,11 @@ #define CONFIG_KEYPAD RECORDER_PAD /* define this if you have a real-time clock */ -#define HAVE_RTC 1 +#define CONFIG_RTC RTC_M41ST84W /* define this if you have RTC RAM available for settings */ #define HAVE_RTC_RAM 1 -/* define this to the type of RTC hardware */ -#define CONFIG_RTC RTC_M41ST84W - /* The number of bytes reserved for loadable plugins */ #define PLUGIN_BUFFER_SIZE 0x8000 diff --git a/firmware/export/config-recorderv2.h b/firmware/export/config-recorderv2.h index 21fe0b20c2..dd0f550626 100644 --- a/firmware/export/config-recorderv2.h +++ b/firmware/export/config-recorderv2.h @@ -13,14 +13,11 @@ #define CONFIG_KEYPAD RECORDER_PAD /* define this if you have a real-time clock */ -#define HAVE_RTC 1 +#define CONFIG_RTC RTC_M41ST84W /* define this if you have RTC RAM available for settings */ #define HAVE_RTC_RAM 1 -/* define this to the type of RTC hardware */ -#define CONFIG_RTC RTC_M41ST84W - /* Define this if you have a software controlled poweroff */ #define HAVE_SW_POWEROFF diff --git a/firmware/export/rtc.h b/firmware/export/rtc.h index fd793bc887..88413c795f 100644 --- a/firmware/export/rtc.h +++ b/firmware/export/rtc.h @@ -21,7 +21,7 @@ #include -#ifdef HAVE_RTC +#ifdef CONFIG_RTC void rtc_init(void); int rtc_read(unsigned char address); int rtc_read_multiple(unsigned char address, unsigned char *buf, int numbytes); @@ -35,6 +35,6 @@ bool rtc_check_alarm_started(bool release_alarm); bool rtc_check_alarm_flag(void); #endif /* HAVE_ALARM_MOD */ -#endif /* HAVE_RTC */ +#endif /* CONFIG_RTC */ #endif -- cgit v1.2.3