diff options
author | Frank Gevaerts <frank@gevaerts.be> | 2009-02-21 01:07:46 +0000 |
---|---|---|
committer | Frank Gevaerts <frank@gevaerts.be> | 2009-02-21 01:07:46 +0000 |
commit | 5ee28017fdb01748a0618848855fb6a5daef1067 (patch) | |
tree | c4231684be60dd54363bf88ed95ca8ee0c6c0b62 | |
parent | f1a7b293daf41ee2cab4127de1e424362ab83192 (diff) | |
download | rockbox-5ee28017fdb01748a0618848855fb6a5daef1067.tar.gz rockbox-5ee28017fdb01748a0618848855fb6a5daef1067.zip |
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.c | 8 |
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) | |||
270 | /* Only charging is desired */ | 270 | /* Only charging is desired */ |
271 | usb_state = USB_POWERED; | 271 | usb_state = USB_POWERED; |
272 | #ifdef HAVE_USBSTACK | 272 | #ifdef HAVE_USBSTACK |
273 | #ifdef USB_STORAGE | ||
273 | usb_core_enable_driver(USB_DRIVER_MASS_STORAGE, false); | 274 | usb_core_enable_driver(USB_DRIVER_MASS_STORAGE, false); |
275 | #endif | ||
276 | #ifdef USB_CHARGING_ONLY | ||
274 | usb_core_enable_driver(USB_DRIVER_CHARGING_ONLY, true); | 277 | usb_core_enable_driver(USB_DRIVER_CHARGING_ONLY, true); |
278 | #endif | ||
275 | usb_attach(); | 279 | usb_attach(); |
276 | #endif | 280 | #endif |
277 | break; | 281 | break; |
@@ -284,8 +288,12 @@ static void usb_thread(void) | |||
284 | * USB_CONNECTED. */ | 288 | * USB_CONNECTED. */ |
285 | usb_state = USB_POWERED; | 289 | usb_state = USB_POWERED; |
286 | #endif | 290 | #endif |
291 | #ifdef USB_STORAGE | ||
287 | usb_core_enable_driver(USB_DRIVER_MASS_STORAGE, true); | 292 | usb_core_enable_driver(USB_DRIVER_MASS_STORAGE, true); |
293 | #endif | ||
294 | #ifdef USB_CHARGING_ONLY | ||
288 | usb_core_enable_driver(USB_DRIVER_CHARGING_ONLY, false); | 295 | usb_core_enable_driver(USB_DRIVER_CHARGING_ONLY, false); |
296 | #endif | ||
289 | 297 | ||
290 | /* Check any drivers enabled at this point for exclusive storage | 298 | /* Check any drivers enabled at this point for exclusive storage |
291 | * access requirements. */ | 299 | * access requirements. */ |