Add HAVE_HOTSWAP_STORAGE_AS_MAIN to detect changed binary after re-inserting the storage on targets that run rockbox from hotswappable storage.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23752 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Thomas Martitz 2009-11-25 22:54:36 +00:00
parent 6c62b1bf3d
commit cfda097394
4 changed files with 16 additions and 3 deletions

View file

@ -622,6 +622,9 @@ static void init(void)
#ifdef HAVE_ACCESSORY_SUPPLY
accessory_supply_set(global_settings.accessory_supply);
#endif
#ifdef HAVE_HOTSWAP_STORAGE_AS_MAIN
check_bootfile(false); /* remember write time and filesize */
#endif
}
#ifdef CPU_PP

View file

@ -79,7 +79,8 @@
#include "playback.h"
#ifdef BOOTFILE
#if !defined(USB_NONE) && !defined(USB_HANDLED_BY_OF)
#if !defined(USB_NONE) && !defined(USB_HANDLED_BY_OF) \
|| defined(HAVE_HOTSWAP_STORAGE_AS_MAIN)
#include "rolo.h"
#endif
#endif
@ -606,6 +607,13 @@ long default_event_handler_ex(long event, void (*callback)(void *), void *parame
audio_resume();
return SYS_CAR_ADAPTER_RESUME;
#endif
#ifdef HAVE_HOTSWAP_STORAGE_AS_MAIN
case SYS_FS_CHANGED:
system_flush();
check_bootfile(true); /* state gotten in main.c:init() */
system_restore();
return SYS_FS_CHANGED;
#endif
#ifdef HAVE_HEADPHONE_DETECTION
case SYS_PHONE_PLUGGED:
unplug_change(true);
@ -682,7 +690,7 @@ int show_logo( void )
}
#ifdef BOOTFILE
#if !defined(USB_NONE) && !defined(USB_HANDLED_BY_OF)
#if !defined(USB_NONE) && !defined(USB_HANDLED_BY_OF) || defined(HAVE_HOTSWAP_STORAGE_AS_MAIN)
/*
memorize/compare details about the BOOTFILE
we don't use dircache because it may not be up to date after

View file

@ -69,7 +69,8 @@ extern int show_logo(void);
int open_utf8(const char* pathname, int flags);
#ifdef BOOTFILE
#if !defined(USB_NONE) && !defined(USB_HANDLED_BY_OF)
#if !defined(USB_NONE) && !defined(USB_HANDLED_BY_OF) \
|| defined(HAVE_HOTSWAP_STORAGE_AS_MAIN)
void check_bootfile(bool do_rolo);
#endif
#endif

View file

@ -32,6 +32,7 @@
#undef HAVE_MULTIDRIVE
#undef NUM_DRIVES
#undef HAVE_HOTSWAP
#undef HAVE_HOTSWAP_STORAGE_AS_MAIN
#undef CONFIG_STORAGE