diff --git a/lib_xua/api/xua_buffer.h b/lib_xua/api/xua_buffer.h index eaaef881..93ca3219 100644 --- a/lib_xua/api/xua_buffer.h +++ b/lib_xua/api/xua_buffer.h @@ -58,7 +58,7 @@ void XUA_Buffer( chanend c_sof, chanend c_aud_ctl, in port p_off_mclk -#ifdef HID_CONTROLS +#if( 0 < HID_CONTROLS ) , chanend c_hid #endif , chanend c_aud @@ -97,7 +97,7 @@ void XUA_Buffer_Ep(chanend c_aud_out, chanend c_sof, chanend c_aud_ctl, in port p_off_mclk -#ifdef HID_CONTROLS +#if( 0 < HID_CONTROLS ) , chanend c_hid #endif #ifdef CHAN_BUFF_CTRL diff --git a/lib_xua/api/xua_conf_default.h b/lib_xua/api/xua_conf_default.h index 677fad9e..5e311e9f 100644 --- a/lib_xua/api/xua_conf_default.h +++ b/lib_xua/api/xua_conf_default.h @@ -425,10 +425,6 @@ #define HID_CONTROLS (0) #endif -#if defined(HID_CONTROLS) && (HID_CONTROLS == 0) -#undef HID_CONTROLS -#endif - /* @brief Defines whether XMOS device runs as master (i.e. drives LR and Bit clocks) * * 0: XMOS is I2S master. 1: CODEC is I2s master. @@ -1177,7 +1173,7 @@ enum USBEndpointNumber_In #ifdef MIDI ENDPOINT_NUMBER_IN_MIDI, #endif -#ifdef HID_CONTROLS +#if( 0 < HID_CONTROLS ) ENDPOINT_NUMBER_IN_HID, #endif #ifdef IAP diff --git a/lib_xua/src/core/buffer/decouple/decouple.xc b/lib_xua/src/core/buffer/decouple/decouple.xc index e503ab71..8e291aef 100644 --- a/lib_xua/src/core/buffer/decouple/decouple.xc +++ b/lib_xua/src/core/buffer/decouple/decouple.xc @@ -12,7 +12,7 @@ #include "usbaudio20.h" /* Defines from the USB Audio 2.0 Specifications */ #endif -#ifdef HID_CONTROLS +#if( 0 < HID_CONTROLS ) #include "user_hid.h" #endif #define MAX(x,y) ((x)>(y) ? (x) : (y)) diff --git a/lib_xua/src/core/buffer/ep/ep_buffer.xc b/lib_xua/src/core/buffer/ep/ep_buffer.xc index b9c01d6b..5916da17 100644 --- a/lib_xua/src/core/buffer/ep/ep_buffer.xc +++ b/lib_xua/src/core/buffer/ep/ep_buffer.xc @@ -19,7 +19,7 @@ #include "xud.h" #include "testct_byref.h" -#ifdef HID_CONTROLS +#if( 0 < HID_CONTROLS ) #include "user_hid.h" unsigned char g_hidData[1] = {0}; #endif @@ -120,7 +120,7 @@ void XUA_Buffer( chanend c_sof, chanend c_aud_ctl, in port p_off_mclk -#ifdef HID_CONTROLS +#if( 0 < HID_CONTROLS ) , chanend c_hid #endif , chanend c_aud @@ -164,7 +164,7 @@ void XUA_Buffer( c_clk_int, #endif c_sof, c_aud_ctl, p_off_mclk -#ifdef HID_CONTROLS +#if( 0 < HID_CONTROLS ) , c_hid #endif #ifdef CHAN_BUFF_CTRL @@ -223,7 +223,7 @@ void XUA_Buffer_Ep(register chanend c_aud_out, chanend c_sof, chanend c_aud_ctl, in port p_off_mclk -#ifdef HID_CONTROLS +#if( 0 < HID_CONTROLS ) , chanend c_hid #endif #ifdef CHAN_BUFF_CTRL @@ -260,7 +260,7 @@ void XUA_Buffer_Ep(register chanend c_aud_out, XUD_ep ep_int = XUD_InitEp(c_ep_int); #endif -#ifdef HID_CONTROLS +#if( 0 < HID_CONTROLS ) XUD_ep ep_hid = XUD_InitEp(c_hid); #endif unsigned u_tmp; @@ -364,7 +364,7 @@ void XUA_Buffer_Ep(register chanend c_aud_out, #endif #endif -#ifdef HID_CONTROLS +#if( 0 < HID_CONTROLS ) XUD_SetReady_In(ep_hid, g_hidData, 1); #endif @@ -875,7 +875,7 @@ void XUA_Buffer_Ep(register chanend c_aud_out, #endif #endif -#ifdef HID_CONTROLS +#if( 0 < HID_CONTROLS ) /* HID Report Data */ case XUD_SetData_Select(c_hid, ep_hid, result): { diff --git a/lib_xua/src/core/endpoint0/descriptor_defs.h b/lib_xua/src/core/endpoint0/descriptor_defs.h index 1985d910..b348d6f1 100644 --- a/lib_xua/src/core/endpoint0/descriptor_defs.h +++ b/lib_xua/src/core/endpoint0/descriptor_defs.h @@ -54,7 +54,7 @@ enum USBInterfaceNumber INTERFACE_NUMBER_IAP_EA_NATIVE_TRANS, #endif #endif -#if defined(HID_CONTROLS) && (HID_CONTROLS != 0) +#if( 0 < HID_CONTROLS ) INTERFACE_NUMBER_HID, #endif INTERFACE_COUNT /* End marker */ diff --git a/lib_xua/src/core/endpoint0/xua_endpoint0.c b/lib_xua/src/core/endpoint0/xua_endpoint0.c index 11833693..b5d1d8b7 100755 --- a/lib_xua/src/core/endpoint0/xua_endpoint0.c +++ b/lib_xua/src/core/endpoint0/xua_endpoint0.c @@ -21,7 +21,7 @@ #include "vendorrequests.h" #include "xc_ptr.h" #include "xua_ep0_uacreqs.h" -#ifdef HID_CONTROLS +#if( 0 < HID_CONTROLS ) #include "hid.h" #endif #if DSD_CHANS_DAC > 0 @@ -492,7 +492,7 @@ void XUA_Endpoint0_loop(XUD_Result_t result, USB_SetupPacket_t sp, chanend c_ep0 switch(sp.bRequest) { -#ifdef HID_CONTROLS +#if( 0 < HID_CONTROLS ) case USB_GET_DESCRIPTOR: /* Check what inteface request is for */ @@ -871,7 +871,7 @@ void XUA_Endpoint0_lite_loop(XUD_Result_t result, USB_SetupPacket_t sp, chanend switch(sp.bRequest) { -#ifdef HID_CONTROLS +#if( 0 < HID_CONTROLS ) case USB_GET_DESCRIPTOR: /* Check what inteface request is for */ diff --git a/lib_xua/src/core/main.xc b/lib_xua/src/core/main.xc index cb9d8af7..5a7aace0 100755 --- a/lib_xua/src/core/main.xc +++ b/lib_xua/src/core/main.xc @@ -259,7 +259,7 @@ XUD_EpType epTypeTableIn[ENDPOINT_COUNT_IN] = { XUD_EPTYPE_CTL | XUD_STATUS_ENAB #ifdef MIDI XUD_EPTYPE_BUL, #endif -#ifdef HID_CONTROLS +#if( 0 < HID_CONTROLS ) XUD_EPTYPE_INT, #endif #ifdef IAP @@ -400,7 +400,7 @@ VENDOR_REQUESTS_PARAMS_DEC_ c_clk_int, #endif c_sof, c_aud_ctl, p_for_mclk_count -#ifdef HID_CONTROLS +#if( 0 < HID_CONTROLS ) , c_xud_in[ENDPOINT_NUMBER_IN_HID] #endif #ifdef CHAN_BUFF_CTRL