diff options
| author | Dave Chapman <dave@dchapman.com> | 2005-12-04 13:05:56 +0000 |
|---|---|---|
| committer | Dave Chapman <dave@dchapman.com> | 2005-12-04 13:05:56 +0000 |
| commit | 5009c9c1b82493421b6cec0fdf8b4f54ec4ff02c (patch) | |
| tree | 8a0d770854730bc01561e0e8418b123f27ccb09c | |
| parent | 11b2ade5c80d6bcd95f65ac1e3aed9dbf59690c5 (diff) | |
| download | rockbox-5009c9c1b82493421b6cec0fdf8b4f54ec4ff02c.zip rockbox-5009c9c1b82493421b6cec0fdf8b4f54ec4ff02c.tar.gz rockbox-5009c9c1b82493421b6cec0fdf8b4f54ec4ff02c.tar.bz2 rockbox-5009c9c1b82493421b6cec0fdf8b4f54ec4ff02c.tar.xz | |
Split the HAVE_RTC define into HAVE_RTC, HAVE_RTC_RAM and CONFIG_RTC - in preparation for targets (H300, iPod) which have a clock (HAVE_RTC) but no general purpose RAM available for settings data (HAVE_RTC_RAM). CONFIG_RTC is used to specify the low-level driver required.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8144 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | apps/gui/gwps.c | 4 | ||||
| -rw-r--r-- | apps/main.c | 2 | ||||
| -rw-r--r-- | apps/settings.c | 6 | ||||
| -rw-r--r-- | firmware/SOURCES | 2 | ||||
| -rw-r--r-- | firmware/export/config-fmrecorder.h | 6 | ||||
| -rw-r--r-- | firmware/export/config-gmini120.h | 6 | ||||
| -rw-r--r-- | firmware/export/config-recorder.h | 6 | ||||
| -rw-r--r-- | firmware/export/config-recorderv2.h | 6 | ||||
| -rw-r--r-- | firmware/export/config.h | 5 |
9 files changed, 38 insertions, 5 deletions
diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c index 6e05517..05c33a0 100644 --- a/apps/gui/gwps.c +++ b/apps/gui/gwps.c @@ -135,7 +135,7 @@ long gui_wps_show(void) about to shut down. lets save the settings. */ if (wps_state.paused) { settings_save(); -#if !defined(HAVE_RTC) && !defined(HAVE_SW_POWEROFF) +#if !defined(HAVE_RTC_RAM) && !defined(HAVE_SW_POWEROFF) ata_flush(); #endif } @@ -293,7 +293,7 @@ long gui_wps_show(void) else audio_pause(); settings_save(); -#if !defined(HAVE_RTC) && !defined(HAVE_SW_POWEROFF) +#if !defined(HAVE_RTC_RAM) && !defined(HAVE_SW_POWEROFF) ata_flush(); /* make sure resume info is saved */ #endif } diff --git a/apps/main.c b/apps/main.c index f11706e..94d6f70 100644 --- a/apps/main.c +++ b/apps/main.c @@ -228,6 +228,8 @@ void init(void) #ifdef HAVE_RTC rtc_init(); +#endif +#ifdef HAVE_RTC_RAM settings_load(SETTINGS_RTC); /* early load parts of global_settings */ #endif diff --git a/apps/settings.c b/apps/settings.c index 49423ab..edcef4a 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -574,7 +574,7 @@ static void init_config_buffer( void ) static int save_config_buffer( void ) { unsigned short chksum; -#ifdef HAVE_RTC +#ifdef HAVE_RTC_RAM unsigned int i; #endif @@ -583,7 +583,7 @@ static int save_config_buffer( void ) config_block[ RTC_BLOCK_SIZE - 2 ] = chksum >> 8; config_block[ RTC_BLOCK_SIZE - 1 ] = chksum & 0xff; -#ifdef HAVE_RTC +#ifdef HAVE_RTC_RAM /* FIXME: okay, it _would_ be cleaner and faster to implement rtc_write so that it would write a number of bytes at a time since the RTC chip supports that, but this will have to do for now 8-) */ @@ -637,7 +637,7 @@ static int load_config_buffer(int which) } } -#ifdef HAVE_RTC +#ifdef HAVE_RTC_RAM if(!correct) { /* If the disk sector was incorrect, reinit the buffer */ diff --git a/firmware/SOURCES b/firmware/SOURCES index aba4e3b..086501c 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES @@ -98,8 +98,10 @@ drivers/mas.c 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/export/config-fmrecorder.h b/firmware/export/config-fmrecorder.h index 28d8239..221472a 100644 --- a/firmware/export/config-fmrecorder.h +++ b/firmware/export/config-fmrecorder.h @@ -15,6 +15,12 @@ /* define this if you have a real-time clock */ #define HAVE_RTC 1 +/* 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 c833435..a756664 100644 --- a/firmware/export/config-gmini120.h +++ b/firmware/export/config-gmini120.h @@ -10,6 +10,12 @@ /* define this if you have a real-time clock */ #define HAVE_RTC 1 +/* 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 32c29b2..97062c1 100644 --- a/firmware/export/config-recorder.h +++ b/firmware/export/config-recorder.h @@ -15,6 +15,12 @@ /* define this if you have a real-time clock */ #define HAVE_RTC 1 +/* 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 fbe9981..21fe0b2 100644 --- a/firmware/export/config-recorderv2.h +++ b/firmware/export/config-recorderv2.h @@ -15,6 +15,12 @@ /* define this if you have a real-time clock */ #define HAVE_RTC 1 +/* 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.h b/firmware/export/config.h index 9764afd..555e062 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h @@ -100,6 +100,11 @@ /* CONFIG_LED */ #define LED_REAL 1 /* SW controlled LED (Archos recorders, player, Gmini) */ #define LED_VIRTUAL 2 /* Virtual LED (icon) (Archos Ondio) */ + +/* CONFIG_RTC */ +#define RTC_M41ST84W 1 +#define RTC_PCF50606 2 + /* else HW controlled LED (iRiver H1x0) */ /* now go and pick yours */ |