diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/usb.c | 13 |
1 files changed, 4 insertions, 9 deletions
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 @@ | |||
31 | #include "usb.h" | 31 | #include "usb.h" |
32 | #include "button.h" | 32 | #include "button.h" |
33 | #include "sprintf.h" | 33 | #include "sprintf.h" |
34 | #include "hwcompat.h" | ||
34 | 35 | ||
35 | extern void dbg_ports(void); /* NASTY! defined in apps/ */ | 36 | extern void dbg_ports(void); /* NASTY! defined in apps/ */ |
36 | 37 | ||
@@ -62,12 +63,13 @@ static char usb_thread_name[] = "usb"; | |||
62 | static struct event_queue usb_queue; | 63 | static struct event_queue usb_queue; |
63 | static bool last_usb_status; | 64 | static bool last_usb_status; |
64 | static bool usb_monitor_enabled; | 65 | static bool usb_monitor_enabled; |
65 | static bool usb_inverted; | ||
66 | 66 | ||
67 | static void usb_enable(bool on) | 67 | static void usb_enable(bool on) |
68 | { | 68 | { |
69 | if(usb_inverted) | 69 | #ifdef HAVE_LCD_BITMAP |
70 | if(read_hw_mask() & USB_ACTIVE_HIGH) | ||
70 | on = !on; | 71 | on = !on; |
72 | #endif | ||
71 | 73 | ||
72 | if(on) | 74 | if(on) |
73 | PADR &= ~0x400; /* enable USB */ | 75 | PADR &= ~0x400; /* enable USB */ |
@@ -262,13 +264,6 @@ void usb_init(void) | |||
262 | usb_monitor_enabled = false; | 264 | usb_monitor_enabled = false; |
263 | countdown = -1; | 265 | countdown = -1; |
264 | 266 | ||
265 | /* This is lame. Really lame. We determine the polarity of the USB | ||
266 | enable pin by checking how it is set by the Archos firmware. */ | ||
267 | if(PADR & 0x400) | ||
268 | usb_inverted = false; | ||
269 | else | ||
270 | usb_inverted = true; | ||
271 | |||
272 | usb_enable(false); | 267 | usb_enable(false); |
273 | 268 | ||
274 | /* We assume that the USB cable is extracted */ | 269 | /* We assume that the USB cable is extracted */ |