summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2004-10-14 21:58:33 +0000
committerJens Arnold <amiconn@rockbox.org>2004-10-14 21:58:33 +0000
commit64a17574e3c8df30a4814a060d1b2c0a9d89f9dd (patch)
tree0fd7a8c2fc7b3283b5b6d67cfe165827f0665223
parent6239cdd898ed3c6661cf879436ebcbb9528288af (diff)
downloadrockbox-64a17574e3c8df30a4814a060d1b2c0a9d89f9dd.tar.gz
rockbox-64a17574e3c8df30a4814a060d1b2c0a9d89f9dd.zip
Fix: Doing the port function setting first in usb_enable() fixes the instability with cold-started rockbox on Ondio (PA5 was high after the first usb_enable(false); with the old init order
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5276 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/usb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/firmware/usb.c b/firmware/usb.c
index 65069c486a..5584d91ea0 100644
--- a/firmware/usb.c
+++ b/firmware/usb.c
@@ -83,6 +83,7 @@ static bool usb_monitor_enabled;
83static void usb_enable(bool on) 83static void usb_enable(bool on)
84{ 84{
85#ifdef USB_ENABLE_ONDIOSTYLE 85#ifdef USB_ENABLE_ONDIOSTYLE
86 PACR2 &= ~0x04C0; /* use PA3, PA5 as GPIO */
86 if(on) 87 if(on)
87 { 88 {
88#ifdef HAVE_MMC 89#ifdef HAVE_MMC
@@ -96,7 +97,6 @@ static void usb_enable(bool on)
96 and_b(~0x20, &PADRL); /* disable USB */ 97 and_b(~0x20, &PADRL); /* disable USB */
97 or_b(0x08, &PADRL); /* deassert card detect */ 98 or_b(0x08, &PADRL); /* deassert card detect */
98 } 99 }
99 PACR2 &= ~0x04C0; /* use PA3, PA5 as GPIO */
100 or_b(0x28, &PAIORL); /* output for USB enable and card detect */ 100 or_b(0x28, &PAIORL); /* output for USB enable and card detect */
101#else /* standard HD Jukebox */ 101#else /* standard HD Jukebox */
102#ifdef HAVE_LCD_BITMAP 102#ifdef HAVE_LCD_BITMAP
@@ -362,7 +362,7 @@ void usb_init(void)
362 362
363 /* We assume that the USB cable is extracted */ 363 /* We assume that the USB cable is extracted */
364 last_usb_status = false; 364 last_usb_status = false;
365 365
366 queue_init(&usb_queue); 366 queue_init(&usb_queue);
367 create_thread(usb_thread, usb_stack, sizeof(usb_stack), usb_thread_name); 367 create_thread(usb_thread, usb_stack, sizeof(usb_stack), usb_thread_name);
368 368