From 80dff15100b5334d6934990bff6228748cf3f4f4 Mon Sep 17 00:00:00 2001 From: Ross Owen Date: Wed, 30 Apr 2014 21:02:43 +0100 Subject: [PATCH] Fixed bad usage of NUM_USB_CHAN_OUT when _IN should have been used. Caused output only build to wait for buffer setup to happened forever.. --- module_usb_audio/endpoint0/endpoint0.c | 8 ++++---- module_usb_audio/usb_buffer/decouple.xc | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/module_usb_audio/endpoint0/endpoint0.c b/module_usb_audio/endpoint0/endpoint0.c index 89963257..8213e87f 100755 --- a/module_usb_audio/endpoint0/endpoint0.c +++ b/module_usb_audio/endpoint0/endpoint0.c @@ -76,10 +76,10 @@ unsigned char mixer1Crossbar[18]; short mixer1Weights[18*8]; unsigned char channelMap[NUM_USB_CHAN_OUT + NUM_USB_CHAN_IN + MAX_MIX_COUNT]; -#if NUM_USB_CHAN_OUT > 0 +#if (NUM_USB_CHAN_OUT > 0) unsigned char channelMapAud[NUM_USB_CHAN_OUT]; #endif -#if NUM_USB_CHAN_IN > 0 +#if (NUM_USB_CHAN_IN > 0) unsigned char channelMapUsb[NUM_USB_CHAN_IN]; #endif unsigned char mixSel[MIX_INPUTS]; @@ -337,7 +337,7 @@ void Endpoint0(chanend c_ep0_out, chanend c_ep0_in, chanend c_audioControl, } } } -#if defined(OUTPUT) && defined(INPUT) +#if (NUM_USB_CHAN_OUT > 0) && (NUM_USB_CHAN_IN > 0) /* Check for stream start stop on output and input audio interfaces */ if(sp.wValue && !g_interfaceAlt[1] && !g_interfaceAlt[2]) { @@ -354,7 +354,7 @@ void Endpoint0(chanend c_ep0_out, chanend c_ep0_in, chanend c_audioControl, /* if input stop and input running and output not running */ UserAudioStreamStop(); } -#elif defined(OUTPUT) || defined(INPUT) +#elif (NUM_USB_CHAN_OUT > 0) || (NUM_USB_CHAN_IN > 0) if(sp.wValue && (!g_interfaceAlt[1])) { /* if start and not currently running */ diff --git a/module_usb_audio/usb_buffer/decouple.xc b/module_usb_audio/usb_buffer/decouple.xc index 092396cd..4ecfd97e 100644 --- a/module_usb_audio/usb_buffer/decouple.xc +++ b/module_usb_audio/usb_buffer/decouple.xc @@ -648,7 +648,7 @@ void decouple(chanend c_mix_out, int aud_from_host_flag=0; xc_ptr released_buffer; #endif -#if (NUM_USB_CHAN_OUT > 0) +#if (NUM_USB_CHAN_IN > 0) int aud_to_host_flag = 0; #endif @@ -721,7 +721,7 @@ void decouple(chanend c_mix_out, XUD_SetReady_OutPtr(aud_from_host_usb_ep, g_aud_from_host_wrptr+4); #endif -#if (NUM_USB_CHAN_OUT > 0) +#if (NUM_USB_CHAN_IN > 0) /* Wait for usb_buffer to set up */ while(!aud_to_host_flag) {