summaryrefslogtreecommitdiffstats
path: root/bootloader
diff options
context:
space:
mode:
authorJames Buren <braewoods+rb@braewoods.net>2020-11-15 09:02:42 +0000
committerJames Buren <braewoods+rb@braewoods.net>2020-11-15 09:49:03 +0000
commit29a20bd20974780345197e4fe2be4b06ad08954b (patch)
tree4abc69cae11b14e689a079ff903da4d946c51be3 /bootloader
parent3ef8455626b80162e22f91e99e76860b0ebc8db5 (diff)
downloadrockbox-29a20bd20974780345197e4fe2be4b06ad08954b.tar.gz
rockbox-29a20bd20974780345197e4fe2be4b06ad08954b.tar.bz2
rockbox-29a20bd20974780345197e4fe2be4b06ad08954b.zip
h1x0/h300: consolidate a few code paths to logical equivalents
This saves a few bytes of precious space by consolidating paths where they can be combined with no change to the underlying algorithm. Change-Id: Ie6b7ead190a87d66fcbdcf2e351010bab751d952
Diffstat (limited to 'bootloader')
-rw-r--r--bootloader/iriver_h1x0.c17
-rw-r--r--bootloader/iriver_h300.c17
2 files changed, 18 insertions, 16 deletions
diff --git a/bootloader/iriver_h1x0.c b/bootloader/iriver_h1x0.c
index d5a3b887a2..7af0e86240 100644
--- a/bootloader/iriver_h1x0.c
+++ b/bootloader/iriver_h1x0.c
@@ -209,25 +209,24 @@ void try_flashboot(void)
if (!firmware_settings.initialized)
return ;
- switch (firmware_settings.bootmethod)
+ switch (firmware_settings.bootmethod)
{
case BOOT_DISK:
return;
case BOOT_ROM:
start_flashed_romimage();
- recovery_mode = true;
break;
case BOOT_RAM:
start_flashed_ramimage();
- recovery_mode = true;
break;
- default:
- recovery_mode = true;
- return;
+ case BOOT_RECOVERY:
+ break;
}
+
+ recovery_mode = true;
}
void failsafe_menu(void)
@@ -451,10 +450,12 @@ void main(void)
/* Power on the hard drive early, to speed up the loading. */
if (!hold_status && !recovery_mode)
+ {
ide_power_enable(true);
- if (!hold_status && (usb_detect() != USB_INSERTED) && !recovery_mode)
- try_flashboot();
+ if (usb_detect() != USB_INSERTED)
+ try_flashboot();
+ }
lcd_init();
diff --git a/bootloader/iriver_h300.c b/bootloader/iriver_h300.c
index ff3c8de2af..6cacbc4a42 100644
--- a/bootloader/iriver_h300.c
+++ b/bootloader/iriver_h300.c
@@ -211,25 +211,24 @@ void try_flashboot(void)
if (!firmware_settings.initialized)
return ;
- switch (firmware_settings.bootmethod)
+ switch (firmware_settings.bootmethod)
{
case BOOT_DISK:
return;
case BOOT_ROM:
start_flashed_romimage();
- recovery_mode = true;
break;
case BOOT_RAM:
start_flashed_ramimage();
- recovery_mode = true;
break;
- default:
- recovery_mode = true;
- return;
+ case BOOT_RECOVERY:
+ break;
}
+
+ recovery_mode = true;
}
void failsafe_menu(void)
@@ -429,10 +428,12 @@ void main(void)
/* Power on the hard drive early, to speed up the loading. */
if (!hold_status && !recovery_mode)
+ {
ide_power_enable(true);
- if (!hold_status && (usb_detect() != USB_INSERTED) && !recovery_mode)
- try_flashboot();
+ if (usb_detect() != USB_INSERTED)
+ try_flashboot();
+ }
lcd_init();
lcd_remote_init();