summaryrefslogtreecommitdiffstats
path: root/firmware/eeprom_settings.c
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2006-08-11 10:13:16 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2006-08-11 10:13:16 +0000
commit3b52bb9c68665c6860c7da6f8ee0b3d8fe26d53d (patch)
tree4a286c9f43aa15899857119b54759141bb68d8dd /firmware/eeprom_settings.c
parent1204136632777e84eac790811fb074552ef2e6b7 (diff)
downloadrockbox-3b52bb9c68665c6860c7da6f8ee0b3d8fe26d53d.tar.gz
rockbox-3b52bb9c68665c6860c7da6f8ee0b3d8fe26d53d.tar.bz2
rockbox-3b52bb9c68665c6860c7da6f8ee0b3d8fe26d53d.zip
Properly handle early USB mode, dircache and tagcache state files with
flashed rockbox. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10525 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/eeprom_settings.c')
-rw-r--r--firmware/eeprom_settings.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/firmware/eeprom_settings.c b/firmware/eeprom_settings.c
index 450eff9623..ad2c9c848f 100644
--- a/firmware/eeprom_settings.c
+++ b/firmware/eeprom_settings.c
@@ -27,13 +27,20 @@
struct eeprom_settings firmware_settings;
-static void reset_config(void)
+static bool reset_config(void)
{
memset(&firmware_settings, 0, sizeof(struct eeprom_settings));
+#ifdef BOOTLOADER
+ /* Don't reset settings if we are inside bootloader. */
+ firmware_settings.initialized = false;
+#else
firmware_settings.version = EEPROM_SETTINGS_VERSION;
firmware_settings.initialized = true;
firmware_settings.boot_disk = false;
firmware_settings.bl_version = 0;
+#endif
+
+ return firmware_settings.initialized;
}
bool eeprom_settings_init(void)
@@ -69,23 +76,20 @@ bool eeprom_settings_init(void)
if (firmware_settings.version != EEPROM_SETTINGS_VERSION)
{
logf("Version mismatch");
- reset_config();
- return true;
+ return reset_config();
}
if (firmware_settings.checksum != sum)
{
logf("Checksum mismatch");
- reset_config();
- return true;
+ return reset_config();
}
#ifndef BOOTLOADER
if (firmware_settings.bl_version < EEPROM_SETTINGS_BL_MINVER)
{
logf("Too old bootloader: %d", firmware_settings.bl_version);
- reset_config();
- return true;
+ return reset_config();
}
#endif