summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2009-02-21 01:07:46 +0000
committerFrank Gevaerts <frank@gevaerts.be>2009-02-21 01:07:46 +0000
commit5ee28017fdb01748a0618848855fb6a5daef1067 (patch)
treec4231684be60dd54363bf88ed95ca8ee0c6c0b62
parentf1a7b293daf41ee2cab4127de1e424362ab83192 (diff)
Only enable drivers if they exist. This should probably be handled differently to avoid #ifdef hell, but at least this way works
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20074 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/usb.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/firmware/usb.c b/firmware/usb.c
index a720215731..8c88ac1d32 100644
--- a/firmware/usb.c
+++ b/firmware/usb.c
@@ -270,8 +270,12 @@ static void usb_thread(void)
/* Only charging is desired */
usb_state = USB_POWERED;
#ifdef HAVE_USBSTACK
+#ifdef USB_STORAGE
usb_core_enable_driver(USB_DRIVER_MASS_STORAGE, false);
+#endif
+#ifdef USB_CHARGING_ONLY
usb_core_enable_driver(USB_DRIVER_CHARGING_ONLY, true);
+#endif
usb_attach();
#endif
break;
@@ -284,8 +288,12 @@ static void usb_thread(void)
* USB_CONNECTED. */
usb_state = USB_POWERED;
#endif
+#ifdef USB_STORAGE
usb_core_enable_driver(USB_DRIVER_MASS_STORAGE, true);
+#endif
+#ifdef USB_CHARGING_ONLY
usb_core_enable_driver(USB_DRIVER_CHARGING_ONLY, false);
+#endif
/* Check any drivers enabled at this point for exclusive storage
* access requirements. */