From 5daf9b043af1c0cb434dd5202f2f427db4e26f2e Mon Sep 17 00:00:00 2001 From: Frank Gevaerts Date: Sat, 1 Mar 2008 19:28:09 +0000 Subject: only initialize class drivers that are actually enabled. This is needed for usb-storage because it grabs the audio buffer during usb_storage_init(), which stops playback. It's probably also the right thing to do for other drivers. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16467 a1c6a512-1295-4272-9138-f99709370657 --- firmware/usbstack/usb_core.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/firmware/usbstack/usb_core.c b/firmware/usbstack/usb_core.c index a864ac8b3a..aa0f06e4f6 100644 --- a/firmware/usbstack/usb_core.c +++ b/firmware/usbstack/usb_core.c @@ -385,15 +385,18 @@ void usb_core_init(void) * won't be used. This simplifies other logic (i.e. we don't need to know * yet which drivers will be enabled */ #ifdef USB_STORAGE - usb_storage_init(); + if(usb_core_storage_enabled) + usb_storage_init(); #endif #ifdef USB_SERIAL - usb_serial_init(); + if(usb_core_serial_enabled) + usb_serial_init(); #endif #ifdef USB_BENCHMARK - usb_benchmark_init(); + if(usb_core_benchmark_enabled) + usb_benchmark_init(); #endif initialized = true; usb_state = DEFAULT; -- cgit v1.2.3