diff options
author | Miika Pekkarinen <miipekk@ihme.org> | 2006-08-11 19:59:16 +0000 |
---|---|---|
committer | Miika Pekkarinen <miipekk@ihme.org> | 2006-08-11 19:59:16 +0000 |
commit | 22860a910a7ddbb9b811fce4cf971e097c8e6eac (patch) | |
tree | 022ce2ca2e0c09561d60295fe1c9c2df1f3e3c62 /bootloader/main.c | |
parent | 3491147fd0be9684261b1cd8e8e9c909a8fb26ce (diff) |
Fixed hold switch detection from bootloader when rockbox has been
flashed.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10533 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'bootloader/main.c')
-rw-r--r-- | bootloader/main.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/bootloader/main.c b/bootloader/main.c index 0ef6d8944e..0b058272f1 100644 --- a/bootloader/main.c +++ b/bootloader/main.c @@ -334,6 +334,28 @@ void main(void) rec_button = ((button_status() & BUTTON_REC) == BUTTON_REC) || ((button_status() & BUTTON_RC_REC) == BUTTON_RC_REC); + /* Don't start if the Hold button is active on the device you + are starting with */ + if (!usb_detect() && ((on_button && button_hold()) || + (rc_on_button && remote_button_hold()))) + { + printf("HOLD switch on, power off..."); + lcd_update(); + sleep(HZ*2); + + /* Backlight OFF */ +#ifdef HAVE_REMOTE_LCD +#ifdef IRIVER_H300_SERIES + or_l(0x00000002, &GPIO1_OUT); +#else + or_l(0x00000800, &GPIO_OUT); +#endif +#endif + /* Reset the cookie for the crt0 crash check */ + asm(" move.l #0,%d0"); + asm(" move.l %d0,0x10017ffc"); + power_off(); + } #ifdef HAVE_EEPROM firmware_settings.initialized = false; @@ -393,28 +415,6 @@ void main(void) } } - /* Don't start if the Hold button is active on the device you - are starting with */ - if(!usb_detect() && ((on_button && button_hold()) || - (rc_on_button && remote_button_hold()))) { - printf("HOLD switch on, power off..."); - lcd_update(); - sleep(HZ*2); - - /* Backlight OFF */ -#ifdef HAVE_REMOTE_LCD -#ifdef IRIVER_H300_SERIES - or_l(0x00000002, &GPIO1_OUT); -#else - or_l(0x00000800, &GPIO_OUT); -#endif -#endif - /* Reset the cookie for the crt0 crash check */ - asm(" move.l #0,%d0"); - asm(" move.l %d0,0x10017ffc"); - power_off(); - } - usb_init(); adc_battery = adc_read(ADC_BATTERY); |