summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2004-11-02 22:57:51 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2004-11-02 22:57:51 +0000
commit01530ac5c8ea6ba0cbdeb8eed6f5035ccfaa5bbb (patch)
treedf2500297f4392017def0461c93314498f51220a /firmware
parenta062b4a22c4d88d7b0b87f9dc1fc07f848f68b00 (diff)
downloadrockbox-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
Diffstat (limited to 'firmware')
-rw-r--r--firmware/usb.c10
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 @@
*
****************************************************************************/
#include "config.h"
-#include "sh7034.h"
+#include "cpu.h"
#include "kernel.h"
#include "thread.h"
#include "system.h"
@@ -301,7 +301,9 @@ bool usb_detect(void)
#ifdef USB_PLAYERSTYLE
current_status = (PADR & 0x8000)?false:true;
#endif
-
+#ifdef IRIVER_H100
+ current_status = (GPIO1_READ & 0x80)?true:false;
+#endif
return current_status;
}
@@ -358,6 +360,10 @@ void usb_init(void)
usb_monitor_enabled = false;
countdown = -1;
+#ifdef IRIVER_H100
+ GPIO1_FUNCTION |= 0x80; /* GPIO39 is the USB detect input */
+#endif
+
usb_enable(false);
/* We assume that the USB cable is extracted */