summaryrefslogtreecommitdiff
path: root/apps/settings.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/settings.c')
-rw-r--r--apps/settings.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/apps/settings.c b/apps/settings.c
index 226ffdc909..1667ce40f8 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -129,7 +129,6 @@ static int save_config_buffer( void )
129 129
130#ifdef HAVE_RTC 130#ifdef HAVE_RTC
131 unsigned int i; 131 unsigned int i;
132 int addr=0x14;
133#endif 132#endif
134 133
135 DEBUGF( "save_config_buffer()\n" ); 134 DEBUGF( "save_config_buffer()\n" );
@@ -148,12 +147,11 @@ static int save_config_buffer( void )
148 that it would write a number of bytes at a time since the RTC chip 147 that it would write a number of bytes at a time since the RTC chip
149 supports that, but this will have to do for now 8-) */ 148 supports that, but this will have to do for now 8-) */
150 for (i=0; i < CONFIG_BLOCK_SIZE; i++ ) { 149 for (i=0; i < CONFIG_BLOCK_SIZE; i++ ) {
151 int r = rtc_write(14, rtc_config_block[i]); 150 int r = rtc_write(0x14+i, rtc_config_block[i]);
152 if (r) { 151 if (r) {
153 DEBUGF( "save_config_buffer: rtc_write failed at addr 0x%02x: %d\n", 14, r ); 152 DEBUGF( "save_config_buffer: rtc_write failed at addr 0x%02x: %d\n", 14+i, r );
154 return r; 153 return r;
155 } 154 }
156 addr++;
157 } 155 }
158 156
159#else 157#else
@@ -176,7 +174,6 @@ static int load_config_buffer( void )
176 unsigned short chksum; 174 unsigned short chksum;
177 175
178#ifdef HAVE_RTC 176#ifdef HAVE_RTC
179 unsigned char addr = 0x14;
180 unsigned int i; 177 unsigned int i;
181#endif 178#endif
182 179
@@ -184,10 +181,8 @@ static int load_config_buffer( void )
184 181
185#ifdef HAVE_RTC 182#ifdef HAVE_RTC
186 /* FIXME: the same comment applies here as for rtc_write */ 183 /* FIXME: the same comment applies here as for rtc_write */
187 for (i=0; i < CONFIG_BLOCK_SIZE; i++ ) { 184 for (i=0; i < CONFIG_BLOCK_SIZE; i++ )
188 rtc_config_block[i] = rtc_read(addr); 185 rtc_config_block[i] = rtc_read(0x14+i);
189 addr++;
190 }
191#else 186#else
192 ata_read_sectors( 61, 1, rtc_config_block); 187 ata_read_sectors( 61, 1, rtc_config_block);
193#endif 188#endif