H300: Bootloader USB mode detection on EXTON wakeup

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8326 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Linus Nielsen Feltzing 2006-01-10 23:11:57 +00:00
parent befd0ac3a6
commit 54da924e43
3 changed files with 6 additions and 4 deletions

View file

@ -175,7 +175,7 @@ void main(void)
power_init();
/* Turn off if neither ON button is pressed */
if(!(on_button || rc_on_button))
if(!(on_button || rc_on_button || usb_detect()))
power_off();
/* Backlight ON */
@ -243,8 +243,8 @@ void main(void)
/* Don't start if the Hold button is active on the device you
are starting with */
if((on_button && button_hold()) ||
(rc_on_button && remote_button_hold())) {
if(!usb_detect() && ((on_button && button_hold()) ||
(rc_on_button && remote_button_hold()))) {
lcd_puts(0, 8, "HOLD switch on, power off...");
lcd_update();
sleep(HZ*2);

View file

@ -281,6 +281,9 @@ void pcf50606_init(void)
set_voltages();
pcf50606_write(0x08, 0x60); /* Wake on USB and charger insertion */
pcf50606_write(0x09, 0x60); /* USB and ON key debounce: 14ms */
/* Backlight PWM = 512Hz 50/50 */
/*pcf50606_write(0x35, 0x13);*/
pcf50606_set_bl_pwm(9);

View file

@ -394,7 +394,6 @@ bool usb_detect(void)
current_status = (P5 & 0x10)?true:false;
#endif
#ifdef IRIVER_H300
/* TODO: add proper code code for H300 USB style */
current_status = (GPIO1_READ & 0x80)?true:false;
#endif
#ifdef USB_IPODSTYLE