summaryrefslogtreecommitdiff
path: root/bootloader
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2006-08-11 19:59:16 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2006-08-11 19:59:16 +0000
commit22860a910a7ddbb9b811fce4cf971e097c8e6eac (patch)
tree022ce2ca2e0c09561d60295fe1c9c2df1f3e3c62 /bootloader
parent3491147fd0be9684261b1cd8e8e9c909a8fb26ce (diff)
downloadrockbox-22860a910a7ddbb9b811fce4cf971e097c8e6eac.tar.gz
rockbox-22860a910a7ddbb9b811fce4cf971e097c8e6eac.zip
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')
-rw-r--r--bootloader/main.c44
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)
334 rec_button = ((button_status() & BUTTON_REC) == BUTTON_REC) 334 rec_button = ((button_status() & BUTTON_REC) == BUTTON_REC)
335 || ((button_status() & BUTTON_RC_REC) == BUTTON_RC_REC); 335 || ((button_status() & BUTTON_RC_REC) == BUTTON_RC_REC);
336 336
337 /* Don't start if the Hold button is active on the device you
338 are starting with */
339 if (!usb_detect() && ((on_button && button_hold()) ||
340 (rc_on_button && remote_button_hold())))
341 {
342 printf("HOLD switch on, power off...");
343 lcd_update();
344 sleep(HZ*2);
345
346 /* Backlight OFF */
347#ifdef HAVE_REMOTE_LCD
348#ifdef IRIVER_H300_SERIES
349 or_l(0x00000002, &GPIO1_OUT);
350#else
351 or_l(0x00000800, &GPIO_OUT);
352#endif
353#endif
354 /* Reset the cookie for the crt0 crash check */
355 asm(" move.l #0,%d0");
356 asm(" move.l %d0,0x10017ffc");
357 power_off();
358 }
337 359
338#ifdef HAVE_EEPROM 360#ifdef HAVE_EEPROM
339 firmware_settings.initialized = false; 361 firmware_settings.initialized = false;
@@ -393,28 +415,6 @@ void main(void)
393 } 415 }
394 } 416 }
395 417
396 /* Don't start if the Hold button is active on the device you
397 are starting with */
398 if(!usb_detect() && ((on_button && button_hold()) ||
399 (rc_on_button && remote_button_hold()))) {
400 printf("HOLD switch on, power off...");
401 lcd_update();
402 sleep(HZ*2);
403
404 /* Backlight OFF */
405#ifdef HAVE_REMOTE_LCD
406#ifdef IRIVER_H300_SERIES
407 or_l(0x00000002, &GPIO1_OUT);
408#else
409 or_l(0x00000800, &GPIO_OUT);
410#endif
411#endif
412 /* Reset the cookie for the crt0 crash check */
413 asm(" move.l #0,%d0");
414 asm(" move.l %d0,0x10017ffc");
415 power_off();
416 }
417
418 usb_init(); 418 usb_init();
419 419
420 adc_battery = adc_read(ADC_BATTERY); 420 adc_battery = adc_read(ADC_BATTERY);