From 5ee28017fdb01748a0618848855fb6a5daef1067 Mon Sep 17 00:00:00 2001 From: Frank Gevaerts Date: Sat, 21 Feb 2009 01:07:46 +0000 Subject: 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 --- firmware/usb.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/firmware/usb.c b/firmware/usb.c index a720215..8c88ac1 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. */ -- cgit v1.1