From abcb6e55b2c3f0430fcdf8d2faf5ebff1ff7c013 Mon Sep 17 00:00:00 2001 From: xross Date: Thu, 2 Nov 2017 14:29:46 +0000 Subject: [PATCH] Fixups to built in main --- lib_xua/src/core/main.xc | 25 +++------- lib_xua/src/core/usb_buffer/usb_buffer.h | 60 ------------------------ 2 files changed, 6 insertions(+), 79 deletions(-) delete mode 100644 lib_xua/src/core/usb_buffer/usb_buffer.h diff --git a/lib_xua/src/core/main.xc b/lib_xua/src/core/main.xc index 11ffe228..00f45f26 100755 --- a/lib_xua/src/core/main.xc +++ b/lib_xua/src/core/main.xc @@ -16,20 +16,16 @@ #include #endif -#include "xud.h" /* XMOS USB Device Layer defines and functions */ #ifndef NO_USB +#include "xud_device.h" /* XMOS USB Device Layer defines and functions */ #include "xua_endpoint0.h" #endif #include "uac_hwresources.h" -#include "usb_buffer.h" -#include "decouple.h" #ifdef MIDI #include "usb_midi.h" #endif -#include "xua_audio.h" - #ifdef IAP #include "i2c_shared.h" #include "iap.h" @@ -374,7 +370,7 @@ VENDOR_REQUESTS_PARAMS_DEC_ asm("setclk res[%0], %1"::"r"(p_for_mclk_count), "r"(x)); #endif //:buffer - buffer(c_xud_out[ENDPOINT_NUMBER_OUT_AUDIO], /* Audio Out*/ + XUA_Buffer(c_xud_out[ENDPOINT_NUMBER_OUT_AUDIO], /* Audio Out*/ c_xud_in[ENDPOINT_NUMBER_IN_AUDIO], /* Audio In */ #if (NUM_USB_CHAN_IN == 0) || defined(UAC_FORCE_FEEDBACK_EP) c_xud_in[ENDPOINT_NUMBER_IN_FEEDBACK], /* Audio FB */ @@ -410,6 +406,7 @@ VENDOR_REQUESTS_PARAMS_DEC_ #ifdef CHAN_BUFF_CTRL , c_buff_ctrl #endif + , c_mix_out ); //: } @@ -420,15 +417,6 @@ VENDOR_REQUESTS_PARAMS_DEC_ XUA_Endpoint0( c_xud_out[0], c_xud_in[0], c_aud_ctl, c_mix_ctl, c_clk_ctl, c_EANativeTransport_ctrl, dfuInterface VENDOR_REQUESTS_PARAMS_); } - /* Decoupling core */ - { - thread_speed(); - decouple(c_mix_out -#ifdef CHAN_BUFF_CTRL - , c_buff_ctrl -#endif - ); - } //: } } @@ -480,14 +468,14 @@ void usb_audio_io(chanend ?c_aud_in, chanend ?c_adc, #else #define AUDIO_CHANNEL c_aud_in #endif - audio(AUDIO_CHANNEL, + XUA_AudioHub(AUDIO_CHANNEL #if defined(SPDIF_TX) && (SPDIF_TX_TILE != AUDIO_IO_TILE) c_spdif_tx, #endif #if defined(SPDIF_RX) || defined(ADAT_RX) c_dig_rx, #endif -#if (XUD_TILE != 0) && (AUDIO_IO_TILE == 0) +#if (XUD_TILE != 0) && (AUDIO_IO_TILE == 0) && (XUA_DFU_EN == 1) , dfuInterface #endif #if (NUM_PDM_MICS > 0) @@ -501,7 +489,6 @@ void usb_audio_io(chanend ?c_aud_in, chanend ?c_adc, thread_speed(); clockGen(c_spdif_rx, c_adat_rx, p_pll_clk, c_dig_rx, c_clk_ctl, c_clk_int); - } #endif @@ -636,7 +623,7 @@ int main() , c_mix_ctl #endif , c_spdif_rx, c_adat_rx, c_clk_ctl, c_clk_int -#if (XUD_TILE != 0) && (AUDIO_IO_TILE == 0) +#if (XUD_TILE != 0) && (AUDIO_IO_TILE == 0) && (XUA_DFU_EN == 1) , dfuInterface #endif #if (NUM_PDM_MICS > 0) diff --git a/lib_xua/src/core/usb_buffer/usb_buffer.h b/lib_xua/src/core/usb_buffer/usb_buffer.h deleted file mode 100644 index dabdbbd1..00000000 --- a/lib_xua/src/core/usb_buffer/usb_buffer.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef __USB_BUFFER_H__ -#define __USB_BUFFER_H__ -/** USB Audio Buffering Thread. - * - * This function buffers USB audio data between the XUD layer and the decouple - * thread. Most of the chanend parameters to the function should be connected to - * XUD_Manager() - * - * \param c_aud_out Audio OUT endpoint channel connected to the XUD - * \param c_aud_in Audio IN endpoint channel connected to the XUD - * \param c_aud_fb Audio feedback endpoint channel connected to the XUD - * \param c_midi_from_host MIDI OUT endpoint channel connected to the XUD - * \param c_midi_to_host MIDI IN endpoint channel connected to the XUD - * \param c_int Audio clocking interrupt endpoint channel connected to the XUD - * \param c_clk_int Optional chanend connected to the clockGen() thread if present - * \param c_sof Start of frame channel connected to the XUD - * \param c_aud_ctl Audio control channel connected to Endpoint0() - * \param p_off_mclk A port that is clocked of the MCLK input (not the MCLK input itself) - */ -#include "devicedefines.h" - -void buffer(chanend c_aud_out, - chanend c_aud_in, -#if (NUM_USB_CHAN_IN == 0) || defined (UAC_FORCE_FEEDBACK_EP) - chanend c_aud_fb, -#endif -#ifdef MIDI - chanend c_midi_from_host, - chanend c_midi_to_host, - chanend c_midi, -#endif -#ifdef IAP - chanend c_iap_from_host, - chanend c_iap_to_host, -#ifdef IAP_INT_EP - chanend c_iap_to_host_int, -#endif - chanend c_iap, -#ifdef IAP_EA_NATIVE_TRANS - chanend c_iap_ea_native_out, - chanend c_iap_ea_native_in, - chanend c_iap_ea_native_ctrl, - chanend c_iap_ea_native_data, -#endif -#endif -#if defined(SPDIF_RX) || defined(ADAT_RX) - chanend ?c_int, - chanend ?c_clk_int, -#endif - chanend c_sof, - chanend c_aud_ctl, - in port p_off_mclk -#ifdef HID_CONTROLS - , chanend c_hid -#endif -#ifdef CHAN_BUFF_CTRL - , chanend c_buff_ctrl -#endif - ); -#endif