mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
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
This commit is contained in:
parent
1204136632
commit
3b52bb9c68
5 changed files with 37 additions and 17 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue