summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2003-05-17 22:12:11 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2003-05-17 22:12:11 +0000
commiteefab57a1ec69cc38bb7d2060147834490116496 (patch)
treec2db23ba5ef5006293519cacd725cddd7fb5b644
parent5a5c869e032a3fb0587562fcb29c78e7e0a4734c (diff)
downloadrockbox-eefab57a1ec69cc38bb7d2060147834490116496.zip
rockbox-eefab57a1ec69cc38bb7d2060147834490116496.tar.gz
rockbox-eefab57a1ec69cc38bb7d2060147834490116496.tar.bz2
rockbox-eefab57a1ec69cc38bb7d2060147834490116496.tar.xz
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
-rw-r--r--firmware/usb.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/firmware/usb.c b/firmware/usb.c
index 1efecb8..2cd5c9b 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 */