Fixed some build warnings, EP num shuffle after Int EP removal

This commit is contained in:
Ross Owen
2012-11-21 18:12:24 +00:00
parent 268018abd6
commit 3b5605dd02
7 changed files with 64 additions and 73 deletions

View File

@@ -360,7 +360,6 @@ int DFUReportResetState(chanend ?c_user_cmd)
int XMOS_DFU_RevertFactory(chanend ?c_user_cmd) int XMOS_DFU_RevertFactory(chanend ?c_user_cmd)
{ {
unsigned int cmd_data[16];
unsigned s = 0; unsigned s = 0;
DFU_OpenFlash(c_user_cmd); DFU_OpenFlash(c_user_cmd);

View File

@@ -74,7 +74,9 @@ unsigned deliver(chanend c_out, chanend ?c_spd_out, unsigned divide, chanend ?c_
unsigned samplesInPrev[NUM_USB_CHAN_IN]; unsigned samplesInPrev[NUM_USB_CHAN_IN];
#endif #endif
unsigned tmp; unsigned tmp;
#if (I2S_CHANS_ADC != 0)
unsigned index; unsigned index;
#endif
#ifdef RAMP_CHECK #ifdef RAMP_CHECK
unsigned prev=0; unsigned prev=0;
int started = 0; int started = 0;

View File

@@ -185,17 +185,17 @@
#define OUTPUT_INTERFACES (0) #define OUTPUT_INTERFACES (0)
#endif #endif
#define NUM_EP_OUT_AUD (OUTPUT_INTERFACES) #define EP_CNT_OUT_AUD (OUTPUT_INTERFACES)
#define NUM_EP_IN_AUD (OUTPUT_INTERFACES + INPUT_INTERFACES) #define EP_CNT_IN_AUD (OUTPUT_INTERFACES + INPUT_INTERFACES)
#if defined(MIDI) #if defined(MIDI)
#define MIDI_INTERFACES (2) #define MIDI_INTERFACES (2)
#define NUM_EP_OUT_MIDI (1) #define EP_CNT_OUT_MIDI (1)
#define NUM_EP_IN_MIDI (1) #define EP_CNT_IN_MIDI (1)
#else #else
#define MIDI_INTERFACES (0) #define MIDI_INTERFACES (0)
#define NUM_EP_OUT_MIDI (0) #define EP_CNT_OUT_MIDI (0)
#define NUM_EP_IN_MIDI (0) #define EP_CNT_IN_MIDI (0)
#endif #endif
#if defined(IAP) #if defined(IAP)
@@ -210,12 +210,17 @@
#define HID_INTERFACES (0) #define HID_INTERFACES (0)
#endif #endif
#define NUM_EP_OUT_IAP (IAP_INTERFACES) #define EP_CNT_OUT_IAP (IAP_INTERFACES)
#define NUM_EP_IN_IAP (IAP_INTERFACES * 2) #define EP_CNT_IN_IAP (IAP_INTERFACES * 2)
#define NUM_EP_OUT_HID (0) #define EP_CNT_OUT_HID (0)
#define NUM_EP_IN_HID (HID_INTERFACES) #define EP_CNT_IN_HID (HID_INTERFACES)
#if defined(SPDIF_RX) || defined(ADAT_RX)
#define EP_CNT_IN_AUD_INT (1)
#else
#define EP_CNT_IN_AUD_INT (0)
#endif
/* Define for number of audio interfaces (+1 for mandatory control interface) */ /* Define for number of audio interfaces (+1 for mandatory control interface) */
#define AUDIO_INTERFACES (INPUT_INTERFACES + OUTPUT_INTERFACES + 1) #define AUDIO_INTERFACES (INPUT_INTERFACES + OUTPUT_INTERFACES + 1)
@@ -227,15 +232,15 @@
/* Endpoint Number Defines */ /* Endpoint Number Defines */
#define EP_NUM_IN_FB (1) /* Always 1 */ #define EP_NUM_IN_FB (1) /* Always 1 */
#define EP_NUM_IN_AUD (2) /* Always 2 */ #define EP_NUM_IN_AUD (2) /* Always 2 */
#define EP_NUM_IN_AUD_INT (3) /* Audio interrupt/status EP */ #define EP_NUM_IN_AUD_INT (EP_NUM_IN_AUD + EP_CNT_IN_AUD_INT) /* Audio interrupt/status EP */
#define EP_NUM_IN_MIDI ((EP_NUM_IN_AUD_INT + 1)) #define EP_NUM_IN_MIDI (EP_NUM_IN_AUD_INT + 1)
#define EP_NUM_IN_HID ((EP_NUM_IN_AUD_INT + NUM_EP_IN_MIDI + 1)) #define EP_NUM_IN_HID (EP_NUM_IN_AUD_INT + EP_CNT_IN_MIDI + 1)
#define EP_NUM_IN_IAP ((EP_NUM_IN_AUD_INT + NUM_EP_IN_MIDI + NUM_EP_IN_HID + 1)) /* iAP Bulk */ #define EP_NUM_IN_IAP (EP_NUM_IN_AUD_INT + EP_CNT_IN_MIDI + EP_CNT_IN_HID + 1) /* iAP Bulk */
#define EP_NUM_IN_IAP_INT ((EP_NUM_IN_AUD_INT + NUM_EP_IN_MIDI + NUM_EP_IN_HID + 2)) /* iAP interrupt */ #define EP_NUM_IN_IAP_INT (EP_NUM_IN_AUD_INT + EP_CNT_IN_MIDI + EP_CNT_IN_HID + 2) /* iAP interrupt */
#define EP_NUM_OUT_AUD 1 /* Always 1 */ #define EP_NUM_OUT_AUD (1) /* Always 1 */
#define EP_NUM_OUT_MIDI 2 /* Always 2 */ #define EP_NUM_OUT_MIDI (2) /* Always 2 */
#define EP_NUM_OUT_IAP 3 /* Always 3 */ #define EP_NUM_OUT_IAP (3) /* Always 3 */
/* Endpoint Address Defines */ /* Endpoint Address Defines */
#define EP_ADR_IN_FB (EP_NUM_IN_FB | 0x80) #define EP_ADR_IN_FB (EP_NUM_IN_FB | 0x80)
@@ -251,8 +256,8 @@
#define EP_ADR_OUT_IAP EP_NUM_OUT_IAP #define EP_ADR_OUT_IAP EP_NUM_OUT_IAP
/* Endpoint count totals */ /* Endpoint count totals */
#define NUM_EP_OUT (1 + 1 /*NUM_EP_OUT_AUD*/ + NUM_EP_OUT_MIDI + NUM_EP_OUT_IAP) /* +1 due to EP0 */ #define EP_CNT_OUT (1 + 1 /*NUM_EP_OUT_AUD*/ + EP_CNT_OUT_MIDI + EP_CNT_OUT_IAP) /* +1 due to EP0 */
#define NUM_EP_IN (2 + 2 /*NUM_EP_IN_AUD*/ + NUM_EP_IN_MIDI + NUM_EP_IN_IAP + NUM_EP_IN_HID) /* +1 due to EP0 and Int EP */ #define EP_CNT_IN (1 + 2 /*NUM_EP_IN_AUD*/ + EP_CNT_IN_AUD_INT + EP_CNT_IN_MIDI + EP_CNT_IN_IAP + EP_CNT_IN_HID) /* +1 due to EP0 */
#define AUDIO_STOP_FOR_DFU (0x12345678) #define AUDIO_STOP_FOR_DFU (0x12345678)
#define AUDIO_START_FROM_DFU (0x87654321) #define AUDIO_START_FROM_DFU (0x87654321)
@@ -263,11 +268,11 @@
/* Length of clock unit/clock-selector units */ /* Length of clock unit/clock-selector units */
#if defined(SPDIF_RX) && defined(ADAT_RX) #if defined(SPDIF_RX) && defined(ADAT_RX)
#define NUM_CLOCKS 3 #define NUM_CLOCKS (3)
#elif defined(SPDIF_RX) || defined(ADAT_RX) #elif defined(SPDIF_RX) || defined(ADAT_RX)
#define NUM_CLOCKS 2 #define NUM_CLOCKS (2)
#else #else
#define NUM_CLOCKS 1 #define NUM_CLOCKS (1)
#endif #endif

View File

@@ -91,8 +91,8 @@ int interfaceAlt[NUM_INTERFACES] = {0, 0, 0, 0};
unsigned g_config = 0; unsigned g_config = 0;
/* Global endpoint status arrays */ /* Global endpoint status arrays */
unsigned g_epStatusOut[NUM_EP_OUT]; unsigned g_epStatusOut[EP_CNT_OUT];
unsigned g_epStatusIn[NUM_EP_IN]; unsigned g_epStatusIn[EP_CNT_IN];
/* Global variable for current USB bus speed (i.e. FS/HS) */ /* Global variable for current USB bus speed (i.e. FS/HS) */
unsigned g_curUsbSpeed = 0; unsigned g_curUsbSpeed = 0;
@@ -115,14 +115,14 @@ void SetEndpointStatus(unsigned epNum, unsigned status)
epNum &= 0x7f; epNum &= 0x7f;
/* Range check */ /* Range check */
if(epNum < NUM_EP_IN) if(epNum < EP_CNT_IN)
{ {
g_epStatusIn[ epNum & 0x7F ] = status; g_epStatusIn[ epNum & 0x7F ] = status;
} }
} }
else else
{ {
if(epNum < NUM_EP_OUT) if(epNum < EP_CNT_OUT)
{ {
g_epStatusOut[ epNum ] = status; g_epStatusOut[ epNum ] = status;
} }
@@ -153,10 +153,10 @@ void Endpoint0( chanend c_ep0_out, chanend c_ep0_in, chanend c_audioControl,
XUD_ep ep0_in = XUD_Init_Ep(c_ep0_in); XUD_ep ep0_in = XUD_Init_Ep(c_ep0_in);
/* Init endpoint status tables */ /* Init endpoint status tables */
for (int i = 0; i++; i < NUM_EP_OUT) for (int i = 0; i++; i < EP_CNT_OUT)
g_epStatusOut[i] = 0; g_epStatusOut[i] = 0;
for (int i = 0; i++; i < NUM_EP_IN) for (int i = 0; i++; i < EP_CNT_IN)
g_epStatusIn[i] = 0; g_epStatusIn[i] = 0;
/* Init tables for volumes (+ 1 for master) */ /* Init tables for volumes (+ 1 for master) */
@@ -713,7 +713,7 @@ void Endpoint0( chanend c_ep0_out, chanend c_ep0_in, chanend c_audioControl,
if( sp.wIndex & 0x80 ) if( sp.wIndex & 0x80 )
{ {
/* IN Endpoint */ /* IN Endpoint */
if((sp.wIndex&0x7f) < NUM_EP_IN) if((sp.wIndex&0x7f) < EP_CNT_IN)
{ {
buffer[0] = ( g_epStatusIn[ sp.wIndex & 0x7F ] & 0xff ); buffer[0] = ( g_epStatusIn[ sp.wIndex & 0x7F ] & 0xff );
buffer[1] = ( g_epStatusIn[ sp.wIndex & 0x7F ] >> 8 ); buffer[1] = ( g_epStatusIn[ sp.wIndex & 0x7F ] >> 8 );
@@ -722,7 +722,7 @@ void Endpoint0( chanend c_ep0_out, chanend c_ep0_in, chanend c_audioControl,
else else
{ {
/* OUT Endpoint */ /* OUT Endpoint */
if(sp.wIndex < NUM_EP_OUT) if(sp.wIndex < EP_CNT_OUT)
{ {
buffer[0] = ( g_epStatusOut[ sp.wIndex ] & 0xff ); buffer[0] = ( g_epStatusOut[ sp.wIndex ] & 0xff );
buffer[1] = ( g_epStatusOut[ sp.wIndex ] >> 8 ); buffer[1] = ( g_epStatusOut[ sp.wIndex ] >> 8 );

View File

@@ -131,17 +131,19 @@ clock clk = XS1_CLKBLK_4;
#endif #endif
/* Endpoint type tables for XUD */ /* Endpoint type tables for XUD */
XUD_EpType epTypeTableOut[NUM_EP_OUT] = { XUD_EPTYPE_CTL | XUD_STATUS_ENABLE, XUD_EpType epTypeTableOut[EP_CNT_OUT] = { XUD_EPTYPE_CTL | XUD_STATUS_ENABLE,
XUD_EPTYPE_ISO, /* Audio */ XUD_EPTYPE_ISO, /* Audio */
#ifdef MIDI #ifdef MIDI
XUD_EPTYPE_BUL /* MIDI */ XUD_EPTYPE_BUL /* MIDI */
#endif #endif
}; };
XUD_EpType epTypeTableIn[NUM_EP_IN] = { XUD_EPTYPE_CTL | XUD_STATUS_ENABLE, XUD_EpType epTypeTableIn[EP_CNT_IN] = { XUD_EPTYPE_CTL | XUD_STATUS_ENABLE,
XUD_EPTYPE_ISO, XUD_EPTYPE_ISO,
XUD_EPTYPE_ISO, XUD_EPTYPE_ISO,
#if defined (SPDIF_RX) || defined (ADAT_RX)
XUD_EPTYPE_BUL, XUD_EPTYPE_BUL,
#endif
#ifdef MIDI #ifdef MIDI
XUD_EPTYPE_BUL, XUD_EPTYPE_BUL,
#endif #endif
@@ -172,8 +174,8 @@ void xscope_user_init()
int main() int main()
{ {
chan c_sof; chan c_sof;
chan c_xud_out[NUM_EP_OUT]; /* Endpoint channels for XUD */ chan c_xud_out[EP_CNT_OUT]; /* Endpoint channels for XUD */
chan c_xud_in[NUM_EP_IN]; chan c_xud_in[EP_CNT_IN];
chan c_aud_ctl; chan c_aud_ctl;
chan c_mix_out; chan c_mix_out;
#ifdef MIDI #ifdef MIDI
@@ -202,11 +204,11 @@ int main()
/* USB Interface */ /* USB Interface */
#if (AUDIO_CLASS==2) #if (AUDIO_CLASS==2)
on stdcore[0]: XUD_Manager(c_xud_out, NUM_EP_OUT, c_xud_in, NUM_EP_IN, on stdcore[0]: XUD_Manager(c_xud_out, EP_CNT_OUT, c_xud_in, EP_CNT_IN,
c_sof, epTypeTableOut, epTypeTableIn, p_usb_rst, c_sof, epTypeTableOut, epTypeTableIn, p_usb_rst,
clk, 1, XUD_SPEED_HS, c_usb_test); clk, 1, XUD_SPEED_HS, c_usb_test);
#else #else
on stdcore[0]:XUD_Manager(c_xud_out, NUM_EP_OUT, c_xud_in, NUM_EP_IN, on stdcore[0]:XUD_Manager(c_xud_out, EP_CNT_OUT, c_xud_in, EP_CNT_IN,
c_sof, epTypeTableOut, epTypeTableIn, p_usb_rst, c_sof, epTypeTableOut, epTypeTableIn, p_usb_rst,
clk, 1, XUD_SPEED_FS, c_usb_test); clk, 1, XUD_SPEED_FS, c_usb_test);
#endif #endif

View File

@@ -559,29 +559,12 @@ void decouple(chanend c_mix_out,
) )
{ {
unsigned sampFreq = DEFAULT_FREQ; unsigned sampFreq = DEFAULT_FREQ;
#ifdef OUTPUT
int aud_from_host_flag=0; int aud_from_host_flag=0;
int aud_to_host_flag=0;
xc_ptr released_buffer; xc_ptr released_buffer;
#endif
#if 0 #ifdef INPUT
//#ifdef IAP int aud_to_host_flag = 0;
xc_ptr iap_from_host_rdptr;
xc_ptr iap_from_host_buffer;
xc_ptr iap_to_host_buffer_being_sent = array_to_xc_ptr(g_iap_to_host_buffer_A);
xc_ptr iap_to_host_buffer_being_collected = array_to_xc_ptr(g_iap_to_host_buffer_B);
xc_ptr zero_buffer = array_to_xc_ptr(g_zero_buffer);
int is_ack_iap;
int is_reset;
int iap_reset;
unsigned int datum_iap;
int iap_data_remaining_to_device = 0;
int iap_data_collected_from_device = 0;
int iap_waiting_on_send_to_host = 0;
int iap_to_host_flag = 0;
int iap_from_host_flag = 0;
int iap_expecting_length = 1;
int iap_expecting_data_length = 0;
#endif #endif
int t = array_to_xc_ptr(outAudioBuff); int t = array_to_xc_ptr(outAudioBuff);

View File

@@ -126,12 +126,12 @@ void buffer(register chanend c_aud_out, register chanend c_aud_in, chanend c_aud
unsigned clocks = 0; unsigned clocks = 0;
#ifdef INPUT
unsigned bufferIn = 1; unsigned bufferIn = 1;
#endif
unsigned remnant = 0, cycles; unsigned remnant = 0, cycles;
unsigned sofCount = 0; unsigned sofCount = 0;
unsigned freqChange = 0; unsigned freqChange = 0;
//unsigned expected = (DEFAULT_FREQ/8000)<<16;
#ifdef FB_TOLERANCE_TEST #ifdef FB_TOLERANCE_TEST
unsigned expected_fb = 0; unsigned expected_fb = 0;