From 09bafcfb3a97e8a32940381c78d21b32691bae0c Mon Sep 17 00:00:00 2001 From: Richard Osborne Date: Mon, 2 Dec 2013 16:40:57 +0000 Subject: [PATCH 1/2] Base the buffer size on the MIDI_USB_BUFFER_TO_HOST_SIZE. The buffer task never writes more than this amount of data to the buffer so there is no point in a bigger buffer. --- module_usb_audio/usb_buffer/usb_buffer.xc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module_usb_audio/usb_buffer/usb_buffer.xc b/module_usb_audio/usb_buffer/usb_buffer.xc index 9e63528d..050e6a8e 100644 --- a/module_usb_audio/usb_buffer/usb_buffer.xc +++ b/module_usb_audio/usb_buffer/usb_buffer.xc @@ -54,8 +54,8 @@ static inline void swap(xc_ptr &a, xc_ptr &b) #endif #ifdef MIDI -static unsigned int g_midi_to_host_buffer_A[MAX_USB_MIDI_PACKET_SIZE/4]; -static unsigned int g_midi_to_host_buffer_B[MAX_USB_MIDI_PACKET_SIZE/4]; +static unsigned int g_midi_to_host_buffer_A[MIDI_USB_BUFFER_TO_HOST_SIZE/4]; +static unsigned int g_midi_to_host_buffer_B[MIDI_USB_BUFFER_TO_HOST_SIZE/4]; static unsigned int g_midi_from_host_buffer[MAX_USB_MIDI_PACKET_SIZE/4]; #endif From b2816ac3aa4163a8b91c6079a89c9a5418292602 Mon Sep 17 00:00:00 2001 From: Richard Osborne Date: Tue, 3 Dec 2013 17:46:58 +0000 Subject: [PATCH 2/2] Remove commented out code. --- module_usb_audio/endpoint0/descriptors.h | 19 ------------------- module_usb_audio/endpoint0/endpoint0.xc | 5 ----- 2 files changed, 24 deletions(-) diff --git a/module_usb_audio/endpoint0/descriptors.h b/module_usb_audio/endpoint0/descriptors.h index 8f76168a..8d494be6 100644 --- a/module_usb_audio/endpoint0/descriptors.h +++ b/module_usb_audio/endpoint0/descriptors.h @@ -2011,23 +2011,4 @@ unsigned char cfgDesc_Audio1[] = }; #endif - -#define APPEND_VENDOR_STR(x) VENDOR_STR#x -#if 0 -static unsigned char strDescs_Audio1[][40] = -{ - "Langids", /* String 0 (LangIDs) place holder */ - APPEND_VENDOR_STR(), // 1 iManufacturer - APPEND_VENDOR_STR(USB Audio 1.0), // 2 iProduct and iInterface for control interface - "",//SERIAL_STR, // 3 iSerialNumber - - APPEND_VENDOR_STR(USB 1.0 Audio Out), // 4 iInterface for Streaming interaces - APPEND_VENDOR_STR(USB 1.0 Audio In), // 5 - - APPEND_VENDOR_STR(Audio 1.0 Output), // 6 "USB Input Terminal" (User sees as output from host) - APPEND_VENDOR_STR(Audio 1.0 Input), // 7 "USB Output Terminal" (User sees as input to host) - - APPEND_VENDOR_STR(DFU) // 8 iInterface for DFU interface -}; -#endif #endif diff --git a/module_usb_audio/endpoint0/endpoint0.xc b/module_usb_audio/endpoint0/endpoint0.xc index 4e5863bd..ef389052 100755 --- a/module_usb_audio/endpoint0/endpoint0.xc +++ b/module_usb_audio/endpoint0/endpoint0.xc @@ -193,11 +193,6 @@ void Endpoint0( chanend c_ep0_out, chanend c_ep0_in, chanend c_audioControl, } #endif - /* Copy langIDs string desc into string[0] */ - /* TODO: Macro? */ -#if defined(AUDIO_CLASS_FALLBACK) || (AUDIO_CLASS == 1) - //safememcpy(strDescs_Audio1[0], strDesc_langIDs, sizeof(strDesc_langIDs)); -#endif safememcpy(strDescs[0], strDesc_langIDs, sizeof(strDesc_langIDs)); /* Build up channel string table - By default all channels are marked as analogue