summaryrefslogtreecommitdiffstats
path: root/bootloader/iriver_h1x0.c
diff options
context:
space:
mode:
authorJames Buren <braewoods+rb@braewoods.net>2020-11-15 10:33:12 +0000
committerJames Buren <braewoods+rb@braewoods.net>2020-11-15 11:01:53 +0000
commit1bc68d5ad77bca333ac69bd4617a1f3af9375e0d (patch)
treed3e799cb15b62893a4b874f8f32454649cdecd06 /bootloader/iriver_h1x0.c
parentfc5c8192ffc8a10ce5f7ccbd96320dfbade1a8ef (diff)
downloadrockbox-1bc68d5ad7.tar.gz
rockbox-1bc68d5ad7.tar.bz2
rockbox-1bc68d5ad7.zip
h1x0/h300: change when the hold switch and failsafe are used
After reviewing the code awhile I realized that the failsafe and hold switch have no impact on the boot process when the usb or charger is connected. That makes no real sense to me. If these are connected then neither will be used at all. The boot process will never revisit it either once those other modes end and resume the boot process. It will just continue to try to boot from disk as if these emergency settings never existed. I have decided it makes more sense for them to be evaluated once the higher priority charge and disk mode have finished their roles. Given how the code was originally written it seems to be they were not intended to run prior to these at the very least since the logical conditions preclude that possibility as they include the inverse of the conditions that trigger the charge and disk modes. Change-Id: I0531c97474572c573178f480c239c3c1659f9653
Diffstat (limited to 'bootloader/iriver_h1x0.c')
-rw-r--r--bootloader/iriver_h1x0.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/bootloader/iriver_h1x0.c b/bootloader/iriver_h1x0.c
index 94ec6cb0fb..7efaaa3308 100644
--- a/bootloader/iriver_h1x0.c
+++ b/bootloader/iriver_h1x0.c
@@ -479,19 +479,6 @@ void main(void)
check_battery();
- /* Don't start if the Hold button is active on the device you
- are starting with */
- if ((usb_detect() != USB_INSERTED) && (hold_status || recovery_mode))
- {
- if (detect_original_firmware())
- {
- printf("Hold switch on");
- shutdown();
- }
-
- failsafe_menu();
- }
-
/* Holding REC while starting runs the original firmware */
if (detect_original_firmware() && rec_button)
{
@@ -544,10 +531,20 @@ void main(void)
lcd_update();
}
- /* boot from flash if that is the default */
- try_flashboot();
- if (recovery_mode)
- printf("Falling back to boot from disk");
+ /* recheck the hold switch status as it may have changed */
+ hold_status = (button_hold() || remote_button_hold());
+
+ /* hold switch shutdown or failsafe recovery mode */
+ if (hold_status || recovery_mode)
+ {
+ if (detect_original_firmware())
+ {
+ printf("Hold switch on");
+ shutdown();
+ }
+
+ failsafe_menu();
+ }
rc = storage_init();
if(rc)