summaryrefslogtreecommitdiffstats
path: root/firmware/usb.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2011-01-18 14:35:56 +0000
committerMichael Sevakis <jethead71@rockbox.org>2011-01-18 14:35:56 +0000
commita3591827add989da9ab48978f5d8cd6fae30d204 (patch)
tree21bb501b297cfe87a118b17faef15dd7d194d195 /firmware/usb.c
parent453550a6877afcda342ac2477cf05028fff053f9 (diff)
downloadrockbox-a3591827add989da9ab48978f5d8cd6fae30d204.tar.gz
rockbox-a3591827add989da9ab48978f5d8cd6fae30d204.tar.bz2
rockbox-a3591827add989da9ab48978f5d8cd6fae30d204.zip
Fix colors from r29084. Had some things in the wrong preprocessor blocks.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29085 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/usb.c')
-rw-r--r--firmware/usb.c80
1 files changed, 40 insertions, 40 deletions
diff --git a/firmware/usb.c b/firmware/usb.c
index 59edd680df..02238e1fc2 100644
--- a/firmware/usb.c
+++ b/firmware/usb.c
@@ -80,9 +80,9 @@ static int usb_mmc_countdown = 0;
static long usb_stack[(DEFAULT_STACK_SIZE + SECTOR_SIZE + DUMP_BMP_LINESIZE)/sizeof(long)];
static const char usb_thread_name[] = "usb";
static unsigned int usb_thread_entry = 0;
+static bool usb_monitor_enabled = false;
#endif /* USB_FULL_INIT */
static struct event_queue usb_queue;
-static bool usb_monitor_enabled = false;
static bool exclusive_storage_access = false;
#ifdef USB_ENABLE_HID
static bool usb_hid = true;
@@ -140,6 +140,21 @@ static inline bool usb_do_screendump(void)
#ifdef HAVE_USBSTACK
+
+#ifdef HAVE_HOTSWAP
+static inline void usb_handle_hotswap(long id)
+{
+ switch(id)
+ {
+ case SYS_HOTSWAP_INSERTED:
+ case SYS_HOTSWAP_EXTRACTED:
+ usb_core_hotswap_event(1, id == SYS_HOTSWAP_INSERTED);
+ break;
+ }
+ /* Note: No MMC storage handling is needed with the stack atm. */
+}
+#endif /* HAVE_HOTSWAP */
+
static inline bool usb_configure_drivers(int for_state)
{
switch(for_state)
@@ -224,21 +239,6 @@ static inline void usb_slave_mode(bool on)
cancel_cpu_boost();
}
}
-
-#ifdef HAVE_HOTSWAP
-static inline void usb_handle_hotswap(long id)
-{
- switch(id)
- {
- case SYS_HOTSWAP_INSERTED:
- case SYS_HOTSWAP_EXTRACTED:
- usb_core_hotswap_event(1, id == SYS_HOTSWAP_INSERTED);
- break;
- }
- /* Note: No MMC storage handling is needed with the stack atm. */
-}
-#endif /* HAVE_HOTSWAP */
-
#else /* !USB_ROCKBOX_USB */
static inline void usb_slave_mode(bool on)
{
@@ -259,6 +259,30 @@ void usb_signal_transfer_completion(
#else /* !HAVE_USBSTACK */
+#ifdef HAVE_HOTSWAP
+static inline void usb_handle_hotswap(long id)
+{
+#if (CONFIG_STORAGE & STORAGE_MMC)
+ switch(id)
+ {
+ case SYS_HOTSWAP_INSERTED:
+ case SYS_HOTSWAP_EXTRACTED:
+ if(usb_state == USB_INSERTED)
+ {
+ usb_enable(false);
+ usb_mmc_countdown = HZ/2; /* re-enable after 0.5 sec */
+ }
+ break;
+ case USB_REENABLE:
+ if(usb_state == USB_INSERTED)
+ usb_enable(true); /* reenable only if still inserted */
+ break;
+ }
+#endif /* STORAGE_MMC */
+ (void)id;
+}
+#endif /* HAVE_HOTSWAP */
+
static inline bool usb_configure_drivers(int for_state)
{
switch(for_state)
@@ -312,30 +336,6 @@ static inline void usb_slave_mode(bool on)
panicf("mount: %d",rc);
}
}
-
-#ifdef HAVE_HOTSWAP
-static inline void usb_handle_hotswap(long id)
-{
-#if (CONFIG_STORAGE & STORAGE_MMC)
- switch(id)
- {
- case SYS_HOTSWAP_INSERTED:
- case SYS_HOTSWAP_EXTRACTED:
- if(usb_state == USB_INSERTED)
- {
- usb_enable(false);
- usb_mmc_countdown = HZ/2; /* re-enable after 0.5 sec */
- }
- break;
- case USB_REENABLE:
- if(usb_state == USB_INSERTED)
- usb_enable(true); /* reenable only if still inserted */
- break;
- }
-#endif /* STORAGE_MMC */
- (void)id;
-}
-#endif /* HAVE_HOTSWAP */
#endif /* HAVE_USBSTACK */
#ifdef HAVE_USB_POWER