1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Dave Chapman 2005-12-04 13:05:56 +00:00
parent 11b2ade5c8
commit 5009c9c1b8
9 changed files with 38 additions and 5 deletions

View file

@ -135,7 +135,7 @@ long gui_wps_show(void)
about to shut down. lets save the settings. */ about to shut down. lets save the settings. */
if (wps_state.paused) { if (wps_state.paused) {
settings_save(); settings_save();
#if !defined(HAVE_RTC) && !defined(HAVE_SW_POWEROFF) #if !defined(HAVE_RTC_RAM) && !defined(HAVE_SW_POWEROFF)
ata_flush(); ata_flush();
#endif #endif
} }
@ -293,7 +293,7 @@ long gui_wps_show(void)
else else
audio_pause(); audio_pause();
settings_save(); 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 */ ata_flush(); /* make sure resume info is saved */
#endif #endif
} }

View file

@ -228,6 +228,8 @@ void init(void)
#ifdef HAVE_RTC #ifdef HAVE_RTC
rtc_init(); rtc_init();
#endif
#ifdef HAVE_RTC_RAM
settings_load(SETTINGS_RTC); /* early load parts of global_settings */ settings_load(SETTINGS_RTC); /* early load parts of global_settings */
#endif #endif

View file

@ -574,7 +574,7 @@ static void init_config_buffer( void )
static int save_config_buffer( void ) static int save_config_buffer( void )
{ {
unsigned short chksum; unsigned short chksum;
#ifdef HAVE_RTC #ifdef HAVE_RTC_RAM
unsigned int i; unsigned int i;
#endif #endif
@ -583,7 +583,7 @@ static int save_config_buffer( void )
config_block[ RTC_BLOCK_SIZE - 2 ] = chksum >> 8; config_block[ RTC_BLOCK_SIZE - 2 ] = chksum >> 8;
config_block[ RTC_BLOCK_SIZE - 1 ] = chksum & 0xff; 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 /* 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 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-) */ 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(!correct)
{ {
/* If the disk sector was incorrect, reinit the buffer */ /* If the disk sector was incorrect, reinit the buffer */

View file

@ -98,8 +98,10 @@ drivers/mas.c
drivers/pcf50606.c drivers/pcf50606.c
#endif #endif
#ifdef HAVE_RTC #ifdef HAVE_RTC
#if CONFIG_RTC == RTC_M41ST84W
drivers/rtc.c drivers/rtc.c
#endif #endif
#endif
drivers/serial.c drivers/serial.c
#endif /* !SIMULATOR */ #endif /* !SIMULATOR */
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP

View file

@ -15,6 +15,12 @@
/* define this if you have a real-time clock */ /* define this if you have a real-time clock */
#define HAVE_RTC 1 #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 this if you have a software controlled poweroff */
#define HAVE_SW_POWEROFF #define HAVE_SW_POWEROFF

View file

@ -10,6 +10,12 @@
/* define this if you have a real-time clock */ /* define this if you have a real-time clock */
#define HAVE_RTC 1 #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 */ /* LCD dimensions */
#define LCD_WIDTH 128 #define LCD_WIDTH 128
#define LCD_HEIGHT 64 #define LCD_HEIGHT 64

View file

@ -15,6 +15,12 @@
/* define this if you have a real-time clock */ /* define this if you have a real-time clock */
#define HAVE_RTC 1 #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 */ /* The number of bytes reserved for loadable plugins */
#define PLUGIN_BUFFER_SIZE 0x8000 #define PLUGIN_BUFFER_SIZE 0x8000

View file

@ -15,6 +15,12 @@
/* define this if you have a real-time clock */ /* define this if you have a real-time clock */
#define HAVE_RTC 1 #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 this if you have a software controlled poweroff */
#define HAVE_SW_POWEROFF #define HAVE_SW_POWEROFF

View file

@ -100,6 +100,11 @@
/* CONFIG_LED */ /* CONFIG_LED */
#define LED_REAL 1 /* SW controlled LED (Archos recorders, player, Gmini) */ #define LED_REAL 1 /* SW controlled LED (Archos recorders, player, Gmini) */
#define LED_VIRTUAL 2 /* Virtual LED (icon) (Archos Ondio) */ #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) */ /* else HW controlled LED (iRiver H1x0) */
/* now go and pick yours */ /* now go and pick yours */