summaryrefslogtreecommitdiff
path: root/bootloader/iriver_h1x0.c
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/iriver_h1x0.c
parent3ef8455626b80162e22f91e99e76860b0ebc8db5 (diff)
downloadrockbox-29a20bd20974780345197e4fe2be4b06ad08954b.tar.gz
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/iriver_h1x0.c')
-rw-r--r--bootloader/iriver_h1x0.c17
1 files changed, 9 insertions, 8 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)
209 if (!firmware_settings.initialized) 209 if (!firmware_settings.initialized)
210 return ; 210 return ;
211 211
212 switch (firmware_settings.bootmethod) 212 switch (firmware_settings.bootmethod)
213 { 213 {
214 case BOOT_DISK: 214 case BOOT_DISK:
215 return; 215 return;
216 216
217 case BOOT_ROM: 217 case BOOT_ROM:
218 start_flashed_romimage(); 218 start_flashed_romimage();
219 recovery_mode = true;
220 break; 219 break;
221 220
222 case BOOT_RAM: 221 case BOOT_RAM:
223 start_flashed_ramimage(); 222 start_flashed_ramimage();
224 recovery_mode = true;
225 break; 223 break;
226 224
227 default: 225 case BOOT_RECOVERY:
228 recovery_mode = true; 226 break;
229 return;
230 } 227 }
228
229 recovery_mode = true;
231} 230}
232 231
233void failsafe_menu(void) 232void failsafe_menu(void)
@@ -451,10 +450,12 @@ void main(void)
451 450
452 /* Power on the hard drive early, to speed up the loading. */ 451 /* Power on the hard drive early, to speed up the loading. */
453 if (!hold_status && !recovery_mode) 452 if (!hold_status && !recovery_mode)
453 {
454 ide_power_enable(true); 454 ide_power_enable(true);
455 455
456 if (!hold_status && (usb_detect() != USB_INSERTED) && !recovery_mode) 456 if (usb_detect() != USB_INSERTED)
457 try_flashboot(); 457 try_flashboot();
458 }
458 459
459 lcd_init(); 460 lcd_init();
460 461