From 01530ac5c8ea6ba0cbdeb8eed6f5035ccfaa5bbb Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Tue, 2 Nov 2004 22:57:51 +0000 Subject: Proper USB detection for iRiver git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5377 a1c6a512-1295-4272-9138-f99709370657 --- firmware/usb.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'firmware') 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 */ -- cgit v1.2.3