mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-15 08:02:34 -05: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
14
apps/main.c
14
apps/main.c
|
|
@ -338,9 +338,17 @@ void init(void)
|
|||
panicf("ata: %d", rc);
|
||||
}
|
||||
|
||||
#ifdef HAVE_EEPROM
|
||||
eeprom_settings_init();
|
||||
#endif
|
||||
|
||||
usb_start_monitoring();
|
||||
while (usb_detect())
|
||||
{ /* enter USB mode early, before trying to mount */
|
||||
{
|
||||
#ifdef HAVE_EEPROM
|
||||
firmware_settings.disk_clean = false;
|
||||
#endif
|
||||
/* enter USB mode early, before trying to mount */
|
||||
if (button_get_w_tmo(HZ/10) == SYS_USB_CONNECTED)
|
||||
#ifdef HAVE_MMC
|
||||
if (!mmc_touched() || (mmc_remove_request() == SYS_MMC_EXTRACTED))
|
||||
|
|
@ -374,10 +382,6 @@ void init(void)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_EEPROM
|
||||
eeprom_settings_init();
|
||||
#endif
|
||||
|
||||
settings_calc_config_sector();
|
||||
|
||||
#if defined(SETTINGS_RESET) || (CONFIG_KEYPAD == IPOD_4G_PAD)
|
||||
|
|
|
|||
|
|
@ -3300,7 +3300,7 @@ void tagcache_unload_ramcache(void)
|
|||
{
|
||||
stat.ramcache = false;
|
||||
/* Just to make sure there is no statefile present. */
|
||||
remove(TAGCACHE_STATEFILE);
|
||||
// remove(TAGCACHE_STATEFILE);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
10
apps/tree.c
10
apps/tree.c
|
|
@ -1368,16 +1368,14 @@ void tree_flush(void)
|
|||
#ifdef HAVE_TC_RAMCACHE
|
||||
tagcache_unload_ramcache();
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAVE_DIRCACHE
|
||||
if (global_settings.dircache)
|
||||
{
|
||||
global_settings.dircache_size = dircache_get_cache_size();
|
||||
# ifdef HAVE_EEPROM
|
||||
if (dircache_is_enabled() && firmware_settings.initialized)
|
||||
{
|
||||
global_settings.dircache_size = dircache_get_cache_size();
|
||||
dircache_save(DIRCACHE_FILE);
|
||||
}
|
||||
# endif
|
||||
dircache_disable();
|
||||
}
|
||||
|
|
@ -1395,6 +1393,10 @@ void tree_restore(void)
|
|||
firmware_settings.disk_clean = false;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_TC_RAMCACHE
|
||||
remove(TAGCACHE_STATEFILE);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_DIRCACHE
|
||||
remove(DIRCACHE_FILE);
|
||||
if (global_settings.dircache)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue