1
0
Fork 0
forked from len0rd/rockbox

Lame attempt to fix USB polarity auto-detection

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1321 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Linus Nielsen Feltzing 2002-07-03 14:16:20 +00:00
parent cd890a5e5e
commit d5ce38c7b8

View file

@ -60,14 +60,14 @@ static char usb_stack[0x800];
static struct event_queue usb_queue; static struct event_queue usb_queue;
static bool last_usb_status; static bool last_usb_status;
static bool usb_monitor_enabled; static bool usb_monitor_enabled;
static bool usb_inverted;
static void usb_enable(bool on) static void usb_enable(bool on)
{ {
#ifdef ARCHOS_RECORDER if(usb_inverted)
if(!on) /* The pin is inverted on the Recorder */ on = !on;
#else
if(on) if(on)
#endif
PADR &= ~0x400; /* enable USB */ PADR &= ~0x400; /* enable USB */
else else
PADR |= 0x400; PADR |= 0x400;
@ -252,7 +252,14 @@ void usb_init(void)
usb_state = USB_EXTRACTED; usb_state = USB_EXTRACTED;
usb_monitor_enabled = false; usb_monitor_enabled = false;
countdown = -1; countdown = -1;
/* This is lame. Really lame. We determine the polarity of the USB
enable pin by checking how it is set by the Archos firmware. */
if(PADR & 0x400)
usb_inverted = false;
else
usb_inverted = true;
usb_enable(false); usb_enable(false);
/* We assume that the USB cable is extracted */ /* We assume that the USB cable is extracted */