From 22860a910a7ddbb9b811fce4cf971e097c8e6eac Mon Sep 17 00:00:00 2001 From: Miika Pekkarinen Date: Fri, 11 Aug 2006 19:59:16 +0000 Subject: 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 --- bootloader/main.c | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'bootloader') 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); -- cgit v1.2.3