1
0
Fork 0
forked from len0rd/rockbox

USB polarity is now taken from the HW info and not by checking the port pin state at boot

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3682 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Linus Nielsen Feltzing 2003-05-17 22:12:11 +00:00
parent 5a5c869e03
commit eefab57a1e

View file

@ -31,6 +31,7 @@
#include "usb.h"
#include "button.h"
#include "sprintf.h"
#include "hwcompat.h"
extern void dbg_ports(void); /* NASTY! defined in apps/ */
@ -62,12 +63,13 @@ static char usb_thread_name[] = "usb";
static struct event_queue usb_queue;
static bool last_usb_status;
static bool usb_monitor_enabled;
static bool usb_inverted;
static void usb_enable(bool on)
{
if(usb_inverted)
#ifdef HAVE_LCD_BITMAP
if(read_hw_mask() & USB_ACTIVE_HIGH)
on = !on;
#endif
if(on)
PADR &= ~0x400; /* enable USB */
@ -262,13 +264,6 @@ void usb_init(void)
usb_monitor_enabled = false;
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);
/* We assume that the USB cable is extracted */