diff options
-rw-r--r-- | apps/main.c | 3 | ||||
-rw-r--r-- | apps/misc.c | 12 | ||||
-rw-r--r-- | apps/misc.h | 3 | ||||
-rw-r--r-- | firmware/export/config-sim.h | 1 |
4 files changed, 16 insertions, 3 deletions
diff --git a/apps/main.c b/apps/main.c index 145153ba37..3e98343708 100644 --- a/apps/main.c +++ b/apps/main.c | |||
@@ -622,6 +622,9 @@ static void init(void) | |||
622 | #ifdef HAVE_ACCESSORY_SUPPLY | 622 | #ifdef HAVE_ACCESSORY_SUPPLY |
623 | accessory_supply_set(global_settings.accessory_supply); | 623 | accessory_supply_set(global_settings.accessory_supply); |
624 | #endif | 624 | #endif |
625 | #ifdef HAVE_HOTSWAP_STORAGE_AS_MAIN | ||
626 | check_bootfile(false); /* remember write time and filesize */ | ||
627 | #endif | ||
625 | } | 628 | } |
626 | 629 | ||
627 | #ifdef CPU_PP | 630 | #ifdef CPU_PP |
diff --git a/apps/misc.c b/apps/misc.c index 6677c5f9b9..307592e346 100644 --- a/apps/misc.c +++ b/apps/misc.c | |||
@@ -79,7 +79,8 @@ | |||
79 | #include "playback.h" | 79 | #include "playback.h" |
80 | 80 | ||
81 | #ifdef BOOTFILE | 81 | #ifdef BOOTFILE |
82 | #if !defined(USB_NONE) && !defined(USB_HANDLED_BY_OF) | 82 | #if !defined(USB_NONE) && !defined(USB_HANDLED_BY_OF) \ |
83 | || defined(HAVE_HOTSWAP_STORAGE_AS_MAIN) | ||
83 | #include "rolo.h" | 84 | #include "rolo.h" |
84 | #endif | 85 | #endif |
85 | #endif | 86 | #endif |
@@ -606,6 +607,13 @@ long default_event_handler_ex(long event, void (*callback)(void *), void *parame | |||
606 | audio_resume(); | 607 | audio_resume(); |
607 | return SYS_CAR_ADAPTER_RESUME; | 608 | return SYS_CAR_ADAPTER_RESUME; |
608 | #endif | 609 | #endif |
610 | #ifdef HAVE_HOTSWAP_STORAGE_AS_MAIN | ||
611 | case SYS_FS_CHANGED: | ||
612 | system_flush(); | ||
613 | check_bootfile(true); /* state gotten in main.c:init() */ | ||
614 | system_restore(); | ||
615 | return SYS_FS_CHANGED; | ||
616 | #endif | ||
609 | #ifdef HAVE_HEADPHONE_DETECTION | 617 | #ifdef HAVE_HEADPHONE_DETECTION |
610 | case SYS_PHONE_PLUGGED: | 618 | case SYS_PHONE_PLUGGED: |
611 | unplug_change(true); | 619 | unplug_change(true); |
@@ -682,7 +690,7 @@ int show_logo( void ) | |||
682 | } | 690 | } |
683 | 691 | ||
684 | #ifdef BOOTFILE | 692 | #ifdef BOOTFILE |
685 | #if !defined(USB_NONE) && !defined(USB_HANDLED_BY_OF) | 693 | #if !defined(USB_NONE) && !defined(USB_HANDLED_BY_OF) || defined(HAVE_HOTSWAP_STORAGE_AS_MAIN) |
686 | /* | 694 | /* |
687 | memorize/compare details about the BOOTFILE | 695 | memorize/compare details about the BOOTFILE |
688 | we don't use dircache because it may not be up to date after | 696 | we don't use dircache because it may not be up to date after |
diff --git a/apps/misc.h b/apps/misc.h index 857d9ab4da..34f754bda3 100644 --- a/apps/misc.h +++ b/apps/misc.h | |||
@@ -69,7 +69,8 @@ extern int show_logo(void); | |||
69 | int open_utf8(const char* pathname, int flags); | 69 | int open_utf8(const char* pathname, int flags); |
70 | 70 | ||
71 | #ifdef BOOTFILE | 71 | #ifdef BOOTFILE |
72 | #if !defined(USB_NONE) && !defined(USB_HANDLED_BY_OF) | 72 | #if !defined(USB_NONE) && !defined(USB_HANDLED_BY_OF) \ |
73 | || defined(HAVE_HOTSWAP_STORAGE_AS_MAIN) | ||
73 | void check_bootfile(bool do_rolo); | 74 | void check_bootfile(bool do_rolo); |
74 | #endif | 75 | #endif |
75 | #endif | 76 | #endif |
diff --git a/firmware/export/config-sim.h b/firmware/export/config-sim.h index 0656da3ac4..ec398c8b2d 100644 --- a/firmware/export/config-sim.h +++ b/firmware/export/config-sim.h | |||
@@ -32,6 +32,7 @@ | |||
32 | #undef HAVE_MULTIDRIVE | 32 | #undef HAVE_MULTIDRIVE |
33 | #undef NUM_DRIVES | 33 | #undef NUM_DRIVES |
34 | #undef HAVE_HOTSWAP | 34 | #undef HAVE_HOTSWAP |
35 | #undef HAVE_HOTSWAP_STORAGE_AS_MAIN | ||
35 | 36 | ||
36 | #undef CONFIG_STORAGE | 37 | #undef CONFIG_STORAGE |
37 | 38 | ||