diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2004-11-02 22:57:51 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2004-11-02 22:57:51 +0000 |
commit | 01530ac5c8ea6ba0cbdeb8eed6f5035ccfaa5bbb (patch) | |
tree | df2500297f4392017def0461c93314498f51220a | |
parent | a062b4a22c4d88d7b0b87f9dc1fc07f848f68b00 (diff) | |
download | rockbox-01530ac5c8ea6ba0cbdeb8eed6f5035ccfaa5bbb.tar.gz rockbox-01530ac5c8ea6ba0cbdeb8eed6f5035ccfaa5bbb.zip |
Proper USB detection for iRiver
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5377 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/usb.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/firmware/usb.c b/firmware/usb.c index 5584d91ea0..181b1ead1a 100644 --- a/firmware/usb.c +++ b/firmware/usb.c | |||
@@ -17,7 +17,7 @@ | |||
17 | * | 17 | * |
18 | ****************************************************************************/ | 18 | ****************************************************************************/ |
19 | #include "config.h" | 19 | #include "config.h" |
20 | #include "sh7034.h" | 20 | #include "cpu.h" |
21 | #include "kernel.h" | 21 | #include "kernel.h" |
22 | #include "thread.h" | 22 | #include "thread.h" |
23 | #include "system.h" | 23 | #include "system.h" |
@@ -301,7 +301,9 @@ bool usb_detect(void) | |||
301 | #ifdef USB_PLAYERSTYLE | 301 | #ifdef USB_PLAYERSTYLE |
302 | current_status = (PADR & 0x8000)?false:true; | 302 | current_status = (PADR & 0x8000)?false:true; |
303 | #endif | 303 | #endif |
304 | 304 | #ifdef IRIVER_H100 | |
305 | current_status = (GPIO1_READ & 0x80)?true:false; | ||
306 | #endif | ||
305 | return current_status; | 307 | return current_status; |
306 | } | 308 | } |
307 | 309 | ||
@@ -358,6 +360,10 @@ void usb_init(void) | |||
358 | usb_monitor_enabled = false; | 360 | usb_monitor_enabled = false; |
359 | countdown = -1; | 361 | countdown = -1; |
360 | 362 | ||
363 | #ifdef IRIVER_H100 | ||
364 | GPIO1_FUNCTION |= 0x80; /* GPIO39 is the USB detect input */ | ||
365 | #endif | ||
366 | |||
361 | usb_enable(false); | 367 | usb_enable(false); |
362 | 368 | ||
363 | /* We assume that the USB cable is extracted */ | 369 | /* We assume that the USB cable is extracted */ |