From 64a17574e3c8df30a4814a060d1b2c0a9d89f9dd Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Thu, 14 Oct 2004 21:58:33 +0000 Subject: 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 --- firmware/usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'firmware/usb.c') 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; static void usb_enable(bool on) { #ifdef USB_ENABLE_ONDIOSTYLE + PACR2 &= ~0x04C0; /* use PA3, PA5 as GPIO */ if(on) { #ifdef HAVE_MMC @@ -96,7 +97,6 @@ static void usb_enable(bool on) and_b(~0x20, &PADRL); /* disable USB */ or_b(0x08, &PADRL); /* deassert card detect */ } - PACR2 &= ~0x04C0; /* use PA3, PA5 as GPIO */ or_b(0x28, &PAIORL); /* output for USB enable and card detect */ #else /* standard HD Jukebox */ #ifdef HAVE_LCD_BITMAP @@ -362,7 +362,7 @@ void usb_init(void) /* We assume that the USB cable is extracted */ last_usb_status = false; - + queue_init(&usb_queue); create_thread(usb_thread, usb_stack, sizeof(usb_stack), usb_thread_name); -- cgit v1.2.3