xpd: Cleaned up whitespace

This commit is contained in:
Ross Owen
2014-09-19 13:14:55 +01:00
parent ee444abce0
commit 085c444f40
7 changed files with 93 additions and 93 deletions

View File

@@ -14,9 +14,9 @@
* \param c_config An optional channel that will be passed on to the
* CODEC configuration functions.
*/
void audio(chanend c_in,
#if (defined(SPDIF_RX) || defined(ADAT_RX))
chanend c_dig,
void audio(chanend c_in,
#if (defined(SPDIF_RX) || defined(ADAT_RX))
chanend c_dig,
#endif
chanend ?c_config, chanend ?c_adc);

View File

@@ -144,9 +144,9 @@ static inline void doI2SClocks(unsigned divide)
/* I2S delivery thread */
#pragma unsafe arrays
unsigned static deliver(chanend c_out, chanend ?c_spd_out, unsigned divide, unsigned curSamFreq,
unsigned static deliver(chanend c_out, chanend ?c_spd_out, unsigned divide, unsigned curSamFreq,
#if(defined(SPDIF_RX) || defined(ADAT_RX))
chanend c_dig_rx,
chanend c_dig_rx,
#endif
chanend ?c_adc)
{
@@ -783,9 +783,9 @@ unsigned static dummy_deliver(chanend c_out)
#define SAMPLES_PER_PRINT 1
void audio(chanend c_mix_out,
void audio(chanend c_mix_out,
#if (defined(ADAT_RX) || defined(SPDIF_RX))
chanend c_dig_rx,
chanend c_dig_rx,
#endif
chanend ?c_config, chanend ?c)
{
@@ -997,9 +997,9 @@ chanend ?c_config, chanend ?c)
#else
null,
#endif
divide, curSamFreq,
divide, curSamFreq,
#if defined (ADAT_RX) || defined (SPDIF_RX)
c_dig_rx,
c_dig_rx,
#endif
c);

View File

@@ -761,7 +761,7 @@ void clockGen (streaming chanend ?c_spdif_rx, chanend ?c_adat_rx, out port p, ch
/* SMUX2 mode - 2 samples from fifo and 4 zero samples */
g_digData[2] = adatSamples[adatRd + 0];
g_digData[3] = adatSamples[adatRd + 1];
g_digData[4] = 0;
g_digData[5] = 0;
g_digData[6] = 0;

View File

@@ -329,7 +329,7 @@ int AudioClassRequests_2(XUD_ep ep0_out, XUD_ep ep0_in, USB_SetupPacket_t &sp, c
outuint(c_clk_ctl, 0);
}
else if(g_curSamFreq < 176400)
{
{
/* SMUX */
outuint(c_clk_ctl, 1);
}

View File

@@ -1153,7 +1153,7 @@ unsigned char hidReportDescriptor[] =
* Samples per channel. e.g (192000+7999/8000) = 24
* Must allow 1 sample extra per chan (24 + 1) = 25
* Multiply by number of channels and bytes 25 * 2 * 4 = 200 bytes
* TODO Output doesn't get modified by channel count
* TODO Output doesn't get modified by channel count
*/
#define MAX_PACKET_SIZE_MULT_OUT_HS ((((MAX_FREQ+7999)/8000)+1) * NUM_USB_CHAN_OUT)
#define MAX_PACKET_SIZE_MULT_OUT_FS ((((MAX_FREQ_FS+999)/1000)+1) * NUM_USB_CHAN_OUT_FS)
@@ -1163,8 +1163,8 @@ unsigned char hidReportDescriptor[] =
#define HS_STREAM_FORMAT_OUTPUT_3_MAXPACKETSIZE (MAX_PACKET_SIZE_MULT_OUT_HS * HS_STREAM_FORMAT_OUTPUT_3_SUBSLOT_BYTES)
#if (HS_STEAM_FORMAT_OUPUT_1_MAXPACKETSIZE > 1024) || (HS_STEAM_FORMAT_OUPUT_2_MAXPACKETSIZE > 1024) \
|| (HS_STEAM_FORMAT_OUPUT_3_MAXPACKETSIZE > 1024)
#error
|| (HS_STEAM_FORMAT_OUPUT_3_MAXPACKETSIZE > 1024)
#error
#endif
#define FS_STREAM_FORMAT_OUTPUT_1_MAXPACKETSIZE (MAX_PACKET_SIZE_MULT_OUT_FS * FS_STREAM_FORMAT_OUTPUT_1_SUBSLOT_BYTES)
@@ -2120,14 +2120,14 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
/* Standard AS Interface Descriptor (4.9.1) */
.Audio_In_StreamInterface_Alt0 =
{
.bLength = 0x09,
.bDescriptorType = USB_DESCTYPE_INTERFACE,
.bInterfaceNumber = INTERFACE_NUMBER_AUDIO_INPUT,
.bAlternateSetting = 0,
.bNumEndpoints = 0,
.bInterfaceClass = USB_CLASS_AUDIO,
.bLength = 0x09,
.bDescriptorType = USB_DESCTYPE_INTERFACE,
.bInterfaceNumber = INTERFACE_NUMBER_AUDIO_INPUT,
.bAlternateSetting = 0,
.bNumEndpoints = 0,
.bInterfaceClass = USB_CLASS_AUDIO,
.bInterfaceSubClass = UAC_INT_SUBCLASS_AUDIOSTREAMING,
.bInterfaceProtocol = 0x20,
.bInterfaceProtocol = 0x20,
.iInterface = 5, /* (String index) */
},
@@ -2135,12 +2135,12 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
/* Standard AS Interface Descriptor (4.9.1) (Alt) */
.Audio_In_StreamInterface_Alt1 =
{
.bLength = 0x09,
.bDescriptorType = USB_DESCTYPE_INTERFACE,
.bInterfaceNumber = INTERFACE_NUMBER_AUDIO_INPUT,
.bAlternateSetting = 1,
.bNumEndpoints = 1,
.bInterfaceClass = USB_CLASS_AUDIO,
.bLength = 0x09,
.bDescriptorType = USB_DESCTYPE_INTERFACE,
.bInterfaceNumber = INTERFACE_NUMBER_AUDIO_INPUT,
.bAlternateSetting = 1,
.bNumEndpoints = 1,
.bInterfaceClass = USB_CLASS_AUDIO,
.bInterfaceSubClass = UAC_INT_SUBCLASS_AUDIOSTREAMING,
.bInterfaceProtocol = UAC_INT_PROTOCOL_IP_VERSION_02_00,
.iInterface = 5, /* (String index) */
@@ -2149,25 +2149,25 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
/* Class Specific AS Interface Descriptor */
.Audio_In_ClassStreamInterface =
{
.bLength = 0x10,
.bLength = 0x10,
.bDescriptorType = UAC_CS_DESCTYPE_INTERFACE,
.bDescriptorSubType = UAC_CS_AS_INTERFACE_SUBTYPE_AS_GENERAL,
.bTerminalLink = ID_OT_USB,
.bmControls = 0x00,
.bFormatType = 0x01,
.bmFormats = UAC_FORMAT_TYPEI_PCM,
.bNrChannels = HS_STREAM_FORMAT_INPUT_1_CHAN_COUNT,
.bmChannelConfig = 0x00000000,
.bDescriptorSubType = UAC_CS_AS_INTERFACE_SUBTYPE_AS_GENERAL,
.bTerminalLink = ID_OT_USB,
.bmControls = 0x00,
.bFormatType = 0x01,
.bmFormats = UAC_FORMAT_TYPEI_PCM,
.bNrChannels = HS_STREAM_FORMAT_INPUT_1_CHAN_COUNT,
.bmChannelConfig = 0x00000000,
.iChannelNames = offsetof(StringDescTable_t, inputChanStr_1)/sizeof(char *),
},
/* Type 1 Format Type Descriptor */
.Audio_In_Format =
{
.bLength = 6,
.bDescriptorType = UAC_CS_DESCTYPE_INTERFACE,
.bLength = 6,
.bDescriptorType = UAC_CS_DESCTYPE_INTERFACE,
.bDescriptorSubtype = UAC_CS_AS_INTERFACE_SUBTYPE_FORMAT_TYPE,
.bFormatType = UAC_FORMAT_TYPE_I,
.bFormatType = UAC_FORMAT_TYPE_I,
.bSubslotSize = HS_STREAM_FORMAT_INPUT_1_SUBSLOT_BYTES, /* Number of bytes per subslot */
.bBitResolution = HS_STREAM_FORMAT_INPUT_1_RESOLUTION_BITS,
},
@@ -2175,10 +2175,10 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
/* Standard AS Isochronous Audio Data Endpoint Descriptor (4.10.1.1) */
.Audio_In_Endpoint =
{
.bLength = 0x07,
.bDescriptorType = USB_DESCTYPE_ENDPOINT,
.bEndpointAddress = 0x82,
.bmAttributes = 5,
.bLength = 0x07,
.bDescriptorType = USB_DESCTYPE_ENDPOINT,
.bEndpointAddress = 0x82,
.bmAttributes = 5,
.wMaxPacketSize = HS_STREAM_FORMAT_INPUT_1_MAXPACKETSIZE,
.bInterval = 0x01,
},
@@ -2199,12 +2199,12 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
/* Standard AS Interface Descriptor (4.9.1) (Alt) */
.Audio_In_StreamInterface_Alt2 =
{
.bLength = 0x09,
.bDescriptorType = USB_DESCTYPE_INTERFACE,
.bInterfaceNumber = INTERFACE_NUMBER_AUDIO_INPUT,
.bAlternateSetting = 2,
.bNumEndpoints = 1,
.bInterfaceClass = USB_CLASS_AUDIO,
.bLength = 0x09,
.bDescriptorType = USB_DESCTYPE_INTERFACE,
.bInterfaceNumber = INTERFACE_NUMBER_AUDIO_INPUT,
.bAlternateSetting = 2,
.bNumEndpoints = 1,
.bInterfaceClass = USB_CLASS_AUDIO,
.bInterfaceSubClass = UAC_INT_SUBCLASS_AUDIOSTREAMING,
.bInterfaceProtocol = UAC_INT_PROTOCOL_IP_VERSION_02_00,
.iInterface = 5, /* (String index) */
@@ -2213,25 +2213,25 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
/* Class Specific AS Interface Descriptor */
.Audio_In_ClassStreamInterface_2 =
{
.bLength = 0x10,
.bLength = 0x10,
.bDescriptorType = UAC_CS_DESCTYPE_INTERFACE,
.bDescriptorSubType = UAC_CS_AS_INTERFACE_SUBTYPE_AS_GENERAL,
.bTerminalLink = ID_OT_USB,
.bmControls = 0x00,
.bFormatType = 0x01,
.bmFormats = UAC_FORMAT_TYPEI_PCM,
.bNrChannels = HS_STREAM_FORMAT_INPUT_2_CHAN_COUNT,
.bmChannelConfig = 0x00000000,
.bDescriptorSubType = UAC_CS_AS_INTERFACE_SUBTYPE_AS_GENERAL,
.bTerminalLink = ID_OT_USB,
.bmControls = 0x00,
.bFormatType = 0x01,
.bmFormats = UAC_FORMAT_TYPEI_PCM,
.bNrChannels = HS_STREAM_FORMAT_INPUT_2_CHAN_COUNT,
.bmChannelConfig = 0x00000000,
.iChannelNames = offsetof(StringDescTable_t, inputChanStr_1)/sizeof(char *),
},
/* Type 1 Format Type Descriptor */
.Audio_In_Format_2 =
{
.bLength = 6,
.bDescriptorType = UAC_CS_DESCTYPE_INTERFACE,
.bLength = 6,
.bDescriptorType = UAC_CS_DESCTYPE_INTERFACE,
.bDescriptorSubtype = UAC_CS_AS_INTERFACE_SUBTYPE_FORMAT_TYPE,
.bFormatType = UAC_FORMAT_TYPE_I,
.bFormatType = UAC_FORMAT_TYPE_I,
.bSubslotSize = HS_STREAM_FORMAT_INPUT_1_SUBSLOT_BYTES, /* TODO SUBSLOT_BYTES currently shared */
.bBitResolution = HS_STREAM_FORMAT_INPUT_1_RESOLUTION_BITS, /* TODO RESOLUTION_BITS currently shared */
},
@@ -2239,10 +2239,10 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
/* Standard AS Isochronous Audio Data Endpoint Descriptor (4.10.1.1) */
.Audio_In_Endpoint_2 =
{
.bLength = 0x07,
.bDescriptorType = USB_DESCTYPE_ENDPOINT,
.bEndpointAddress = 0x82,
.bmAttributes = 5,
.bLength = 0x07,
.bDescriptorType = USB_DESCTYPE_ENDPOINT,
.bEndpointAddress = 0x82,
.bmAttributes = 5,
.wMaxPacketSize = HS_STREAM_FORMAT_INPUT_2_MAXPACKETSIZE,
.bInterval = 0x01,
},
@@ -2264,12 +2264,12 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
/* Standard AS Interface Descriptor (4.9.1) (Alt) */
.Audio_In_StreamInterface_Alt3 =
{
.bLength = 0x09,
.bDescriptorType = USB_DESCTYPE_INTERFACE,
.bInterfaceNumber = INTERFACE_NUMBER_AUDIO_INPUT,
.bAlternateSetting = 3,
.bNumEndpoints = 1,
.bInterfaceClass = USB_CLASS_AUDIO,
.bLength = 0x09,
.bDescriptorType = USB_DESCTYPE_INTERFACE,
.bInterfaceNumber = INTERFACE_NUMBER_AUDIO_INPUT,
.bAlternateSetting = 3,
.bNumEndpoints = 1,
.bInterfaceClass = USB_CLASS_AUDIO,
.bInterfaceSubClass = UAC_INT_SUBCLASS_AUDIOSTREAMING,
.bInterfaceProtocol = UAC_INT_PROTOCOL_IP_VERSION_02_00,
.iInterface = 5, /* (String index) */
@@ -2278,25 +2278,25 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
/* Class Specific AS Interface Descriptor */
.Audio_In_ClassStreamInterface_3 =
{
.bLength = 0x10,
.bLength = 0x10,
.bDescriptorType = UAC_CS_DESCTYPE_INTERFACE,
.bDescriptorSubType = UAC_CS_AS_INTERFACE_SUBTYPE_AS_GENERAL,
.bTerminalLink = ID_OT_USB,
.bmControls = 0x00,
.bFormatType = 0x01,
.bmFormats = UAC_FORMAT_TYPEI_PCM,
.bNrChannels = HS_STREAM_FORMAT_INPUT_3_CHAN_COUNT,
.bmChannelConfig = 0x00000000,
.bDescriptorSubType = UAC_CS_AS_INTERFACE_SUBTYPE_AS_GENERAL,
.bTerminalLink = ID_OT_USB,
.bmControls = 0x00,
.bFormatType = 0x01,
.bmFormats = UAC_FORMAT_TYPEI_PCM,
.bNrChannels = HS_STREAM_FORMAT_INPUT_3_CHAN_COUNT,
.bmChannelConfig = 0x00000000,
.iChannelNames = offsetof(StringDescTable_t, inputChanStr_1)/sizeof(char *),
},
/* Type 1 Format Type Descriptor */
.Audio_In_Format_3 =
{
.bLength = 6,
.bDescriptorType = UAC_CS_DESCTYPE_INTERFACE,
.bLength = 6,
.bDescriptorType = UAC_CS_DESCTYPE_INTERFACE,
.bDescriptorSubtype = UAC_CS_AS_INTERFACE_SUBTYPE_FORMAT_TYPE,
.bFormatType = UAC_FORMAT_TYPE_I,
.bFormatType = UAC_FORMAT_TYPE_I,
.bSubslotSize = HS_STREAM_FORMAT_INPUT_1_SUBSLOT_BYTES, /* TODO SUBSLOT_BYTES currently shared */
.bBitResolution = HS_STREAM_FORMAT_INPUT_1_RESOLUTION_BITS, /* TODO RESOLUTION_BITS currently shared */
},
@@ -2304,10 +2304,10 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
/* Standard AS Isochronous Audio Data Endpoint Descriptor (4.10.1.1) */
.Audio_In_Endpoint_3 =
{
.bLength = 0x07,
.bDescriptorType = USB_DESCTYPE_ENDPOINT,
.bEndpointAddress = 0x82,
.bmAttributes = 5,
.bLength = 0x07,
.bDescriptorType = USB_DESCTYPE_ENDPOINT,
.bEndpointAddress = 0x82,
.bmAttributes = 5,
.wMaxPacketSize = HS_STREAM_FORMAT_INPUT_3_MAXPACKETSIZE,
.bInterval = 0x01,
},

View File

@@ -117,7 +117,7 @@ const unsigned g_subSlot_Out_FS[OUTPUT_FORMAT_COUNT] = {FS_STREAM_FORMAT_OUTP
#endif
};
const unsigned g_subSlot_In_HS[INPUT_FORMAT_COUNT] = {HS_STREAM_FORMAT_INPUT_1_SUBSLOT_BYTES,
const unsigned g_subSlot_In_HS[INPUT_FORMAT_COUNT] = {HS_STREAM_FORMAT_INPUT_1_SUBSLOT_BYTES,
#if(INPUT_FORMAT_COUNT > 1)
HS_STREAM_FORMAT_INPUT_2_SUBSLOT_BYTES,
#endif
@@ -193,9 +193,9 @@ const unsigned g_dataFormat_In[INPUT_FORMAT_COUNT] = {STREAM_FORMAT_INPUT_1
/* Channel count */
/* Note, currently only input changes.. */
const unsigned g_chanCount_In_HS[INPUT_FORMAT_COUNT] = {HS_STREAM_FORMAT_INPUT_1_CHAN_COUNT,
const unsigned g_chanCount_In_HS[INPUT_FORMAT_COUNT] = {HS_STREAM_FORMAT_INPUT_1_CHAN_COUNT,
#if(INPUT_FORMAT_COUNT > 1)
HS_STREAM_FORMAT_INPUT_2_CHAN_COUNT,
HS_STREAM_FORMAT_INPUT_2_CHAN_COUNT,
#endif
#if(INPUT_FORMAT_COUNT > 2)
HS_STREAM_FORMAT_INPUT_3_CHAN_COUNT

View File

@@ -429,15 +429,15 @@ chanend ?c_clk_int
{
thread_speed();
#ifdef MIXER
audio(c_mix_out,
audio(c_mix_out,
#if defined(SPDIF_RX) || defined(ADAT_RX)
c_dig_rx,
c_dig_rx,
#endif
c_aud_cfg, c_adc);
#else
audio(c_aud_in,
audio(c_aud_in,
#if defined(SPDIF_RX) || defined(ADAT_RX)
c_dig_rx,
c_dig_rx,
#endif
c_aud_cfg, c_adc);
#endif
@@ -573,9 +573,9 @@ int main()
#endif
#ifdef ADAT_RX
on stdcore[0] :
on stdcore[0] :
{
set_thread_fast_mode_on();
set_thread_fast_mode_on();
set_port_clock(p_adat_rx, clk_adat_rx);
start_clock(clk_adat_rx);
while (1)