summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2006-01-10 23:11:57 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2006-01-10 23:11:57 +0000
commit54da924e43c75235d32c0f2c6d0fcb1028105bd5 (patch)
tree847ce635b67a18148f1f98483f1c9f281825f68d
parentbefd0ac3a61b70a86ee909ebb9dd59e074a9f9e8 (diff)
downloadrockbox-54da924e43c75235d32c0f2c6d0fcb1028105bd5.zip
rockbox-54da924e43c75235d32c0f2c6d0fcb1028105bd5.tar.gz
rockbox-54da924e43c75235d32c0f2c6d0fcb1028105bd5.tar.bz2
rockbox-54da924e43c75235d32c0f2c6d0fcb1028105bd5.tar.xz
H300: Bootloader USB mode detection on EXTON wakeup
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8326 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--bootloader/main.c6
-rw-r--r--firmware/drivers/pcf50606.c3
-rw-r--r--firmware/usb.c1
3 files changed, 6 insertions, 4 deletions
diff --git a/bootloader/main.c b/bootloader/main.c
index 482abdd..40f7a05 100644
--- a/bootloader/main.c
+++ b/bootloader/main.c
@@ -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);
diff --git a/firmware/drivers/pcf50606.c b/firmware/drivers/pcf50606.c
index cb05d25..2504498 100644
--- a/firmware/drivers/pcf50606.c
+++ b/firmware/drivers/pcf50606.c
@@ -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);
diff --git a/firmware/usb.c b/firmware/usb.c
index 23e2e33..98f224f 100644
--- a/firmware/usb.c
+++ b/firmware/usb.c
@@ -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