From eefab57a1ec69cc38bb7d2060147834490116496 Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Sat, 17 May 2003 22:12:11 +0000 Subject: 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 --- firmware/usb.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'firmware') diff --git a/firmware/usb.c b/firmware/usb.c index 1efecb8705..2cd5c9b93b 100644 --- a/firmware/usb.c +++ b/firmware/usb.c @@ -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 */ -- cgit v1.2.3