Max packet size defines added and used for for maxPacketLength

This commit is contained in:
Ross Owen
2013-09-18 14:53:30 +01:00
parent e8abe94f07
commit 01c5c2b1a8

View File

@@ -304,7 +304,6 @@ unsigned char hidReportDescriptor[] = {
}; };
#endif #endif
#define HID_LENGTH (25 * HID_INTERFACES) #define HID_LENGTH (25 * HID_INTERFACES)
/* Total length of config descriptor */ /* Total length of config descriptor */
@@ -324,7 +323,8 @@ unsigned char hidReportDescriptor[] = {
* Must allow 1 sample extra per chan (24 + 1) = 25 * Must allow 1 sample extra per chan (24 + 1) = 25
* Multiply by number of channels and bytes 25 * 2 * 4 = 200 bytes * Multiply by number of channels and bytes 25 * 2 * 4 = 200 bytes
*/ */
#define MAX_PACKET_SIZE_OUT_AUDIO_2 ((((MAX_FREQ+7999)/8000)+1) * NUM_USB_CHAN_OUT * 4) #define MAX_PACKET_SIZE_OUT_HS ((((MAX_FREQ+7999)/8000)+1) * NUM_USB_CHAN_OUT * 4)
#define MAX_PACKET_SIZE_OUT_FS ((((MAX_FREQ_A1+999)/1000)+1) * NUM_USB_CHAN_OUT_FS * 3) // Samples per channel
/* Configuration Descriptor for Audio 2.0 (HS) operation */ /* Configuration Descriptor for Audio 2.0 (HS) operation */
unsigned char cfgDesc_Audio2[] = unsigned char cfgDesc_Audio2[] =
@@ -857,9 +857,9 @@ unsigned char cfgDesc_Audio2[] =
USB_ENDPOINT, /* 1 bDescriptorType: ENDPOINT */ USB_ENDPOINT, /* 1 bDescriptorType: ENDPOINT */
0x01, /* 2 bEndpointAddress (D7: 0:out, 1:in) */ 0x01, /* 2 bEndpointAddress (D7: 0:out, 1:in) */
0x05, /* 3 bmAttributes (bitmap) */ 0x05, /* 3 bmAttributes (bitmap) */
//(MAX_PACKET_SIZE_OUT_AUDIO_2)&0xff, /* 4 wMaxPacketSize */ MAX_PACKET_SIZE_OUT_HS&0xff, /* 4 wMaxPacketSize */
//(MAX_PACKET_SIZE_OUT_AUDIO_2&0xff00)>>8, /* 5 wMaxPacketSize */ (MAX_PACKET_SIZE_OUT_HS&0xff00)>>8, /* 5 wMaxPacketSize */
0, 4, //0, 4, // 1024
1, /* 6 bInterval */ 1, /* 6 bInterval */
/* Class-Specific AS Isochronous Audio Data Endpoint Descriptor (4.10.1.2) */ /* Class-Specific AS Isochronous Audio Data Endpoint Descriptor (4.10.1.2) */
@@ -1751,7 +1751,7 @@ unsigned char cfgDesc_Audio1[] =
0x01, /* Terminal ID */ 0x01, /* Terminal ID */
0x01, 0x01, /* Type - streaming */ 0x01, 0x01, /* Type - streaming */
0x00, /* Associated terminal - unused */ 0x00, /* Associated terminal - unused */
2, /* bNrChannels */ NUM_USB_CHAN_OUT_FS, /* bNrChannels */
0x03, 0x00, /* wChannelConfig */ 0x03, 0x00, /* wChannelConfig */
0x00, /* iChannelNames - Unused */ 0x00, /* iChannelNames - Unused */
11, /* iTerminal */ 11, /* iTerminal */
@@ -1788,7 +1788,7 @@ unsigned char cfgDesc_Audio1[] =
0x02, /* Terminal ID */ 0x02, /* Terminal ID */
0x01, 0x02, /* Type - streaming in, mic */ 0x01, 0x02, /* Type - streaming in, mic */
0x00, /* Associated terminal - unused */ 0x00, /* Associated terminal - unused */
2, /* bNrChannels */ NUM_USB_CHAN_IN_FS, /* bNrChannels */
0x03, 0x00, /* wChannelConfigs */ 0x03, 0x00, /* wChannelConfigs */
0x00, /* iChannelNames */ 0x00, /* iChannelNames */
12, /* iTerminal */ 12, /* iTerminal */
@@ -1852,7 +1852,7 @@ unsigned char cfgDesc_Audio1[] =
CS_INTERFACE, CS_INTERFACE,
0x02, /* Subtype - FORMAT_TYPE */ 0x02, /* Subtype - FORMAT_TYPE */
0x01, /* Format type - FORMAT_TYPE_1 */ 0x01, /* Format type - FORMAT_TYPE_1 */
2, /* nrChannels */ NUM_USB_CHAN_OUT_FS, /* nrChannels */
0x03, /* subFrameSize - 4 bytes per slot */ 0x03, /* subFrameSize - 4 bytes per slot */
24, /* bitResolution - 24bit */ 24, /* bitResolution - 24bit */
0x04, /* SamFreqType - 4 sample freq */ 0x04, /* SamFreqType - 4 sample freq */
@@ -1935,7 +1935,7 @@ unsigned char cfgDesc_Audio1[] =
CS_INTERFACE, CS_INTERFACE,
0x02, /* Subtype - FORMAT_TYPE */ 0x02, /* Subtype - FORMAT_TYPE */
0x01, /* Format type - FORMAT_TYPE_1 */ 0x01, /* Format type - FORMAT_TYPE_1 */
2, /* bNrChannels - 2 */ NUM_USB_CHAN_IN_FS, /* bNrChannels - 2 */
0x03, /* subFrameSize - 4 bytes per slot */ 0x03, /* subFrameSize - 4 bytes per slot */
24, /* bitResolution - 24bit */ 24, /* bitResolution - 24bit */
0x04, /* SamFreqType - 4 sample freq */ 0x04, /* SamFreqType - 4 sample freq */