From 16ce73391aa9f24870db7dc5eeb5dc1612fe7ac8 Mon Sep 17 00:00:00 2001 From: xross Date: Tue, 25 Oct 2022 19:18:28 +0100 Subject: [PATCH] xpd: Cleaned up whitespace --- examples/AN00246_xua_example/src/hwsupport.xc | 2 +- .../src/hwsupport.xc | 2 +- lib_xua/api/xua_buffer.h | 2 +- lib_xua/api/xua_conf_default.h | 4 +- lib_xua/api/xua_endpoint0.h | 10 ++-- lib_xua/src/core/clocking/clockgen.xc | 14 +++--- .../src/core/endpoint0/xua_ep0_descriptors.h | 4 +- lib_xua/src/core/main.xc | 6 +-- tests/test_sync_clk_basic/src/main.xc | 46 +++++++++---------- tests/test_sync_clk_basic/src/xua_conf.h | 2 +- tests/test_sync_clk_plugin/src/xua_conf.h | 2 +- 11 files changed, 47 insertions(+), 47 deletions(-) diff --git a/examples/AN00246_xua_example/src/hwsupport.xc b/examples/AN00246_xua_example/src/hwsupport.xc index 1ca91a3f..5f019752 100644 --- a/examples/AN00246_xua_example/src/hwsupport.xc +++ b/examples/AN00246_xua_example/src/hwsupport.xc @@ -8,7 +8,7 @@ on tile[0]: out port p_ctrl = XS1_PORT_8D; /* p_ctrl: - * [0:3] - Unused + * [0:3] - Unused * [4] - EN_3v3_N * [5] - EN_3v3A * [6] - EXT_PLL_SEL (CS2100:0, SI: 1) diff --git a/examples/AN00247_xua_example_spdif_tx/src/hwsupport.xc b/examples/AN00247_xua_example_spdif_tx/src/hwsupport.xc index 1ca91a3f..5f019752 100644 --- a/examples/AN00247_xua_example_spdif_tx/src/hwsupport.xc +++ b/examples/AN00247_xua_example_spdif_tx/src/hwsupport.xc @@ -8,7 +8,7 @@ on tile[0]: out port p_ctrl = XS1_PORT_8D; /* p_ctrl: - * [0:3] - Unused + * [0:3] - Unused * [4] - EN_3v3_N * [5] - EN_3v3A * [6] - EXT_PLL_SEL (CS2100:0, SI: 1) diff --git a/lib_xua/api/xua_buffer.h b/lib_xua/api/xua_buffer.h index 0df6e1be..d7d182d7 100644 --- a/lib_xua/api/xua_buffer.h +++ b/lib_xua/api/xua_buffer.h @@ -32,7 +32,7 @@ void XUA_Buffer( #if (NUM_USB_CHAN_IN > 0) || defined(__DOXYGEN__) chanend c_aud_in, #endif -#if (NUM_USB_CHAN_IN == 0) || defined (UAC_FORCE_FEEDBACK_EP) +#if (NUM_USB_CHAN_IN == 0) || defined (UAC_FORCE_FEEDBACK_EP) chanend c_aud_fb, #endif #if defined(MIDI) || defined(__DOXYGEN__) diff --git a/lib_xua/api/xua_conf_default.h b/lib_xua/api/xua_conf_default.h index 7d426f07..9b89d8d3 100644 --- a/lib_xua/api/xua_conf_default.h +++ b/lib_xua/api/xua_conf_default.h @@ -966,7 +966,7 @@ * Default: XUA_POWERMODE_BUS */ #ifndef XUA_POWERMODE -#define XUA_POWERMODE XUA_POWERMODE_BUS +#define XUA_POWERMODE XUA_POWERMODE_BUS #endif /** @@ -1136,7 +1136,7 @@ #undef UAC_FORCE_FEEDBACK_EP #endif -/* Synchronisation defines */ +/* Synchronisation defines */ #define XUA_SYNCMODE_ASYNC (1) // USB_ENDPOINT_SYNCTYPE_ASYNC #define XUA_SYNCMODE_ADAPT (2) // USB_ENDPOINT_SYNCTYPE_ADAPT #define XUA_SYNCMODE_SYNC (3) // USB_ENDPOINT_SYNCTYPE_SYNC diff --git a/lib_xua/api/xua_endpoint0.h b/lib_xua/api/xua_endpoint0.h index 64ebf52c..efa6cb62 100644 --- a/lib_xua/api/xua_endpoint0.h +++ b/lib_xua/api/xua_endpoint0.h @@ -22,15 +22,15 @@ * present * \param c_clk_ctl Optional chanend to be connected to the clockgen core if * present - * \param dfuInterface Interface to DFU task (this task must be run on a tile - * connected to boot flash. + * \param dfuInterface Interface to DFU task (this task must be run on a tile + * connected to boot flash. * \param c_EANativeTransport_ctrl Optional chanend to be connected to EA Native * endpoint manager if present */ -void XUA_Endpoint0(chanend c_ep0_out, +void XUA_Endpoint0(chanend c_ep0_out, chanend c_ep0_in, chanend ?c_audioCtrl, - chanend ?c_mix_ctl, chanend ?c_clk_ctl, - chanend ?c_EANativeTransport_ctrl, + chanend ?c_mix_ctl, chanend ?c_clk_ctl, + chanend ?c_EANativeTransport_ctrl, client interface i_dfu ?dfuInterface #if !defined(__DOXYGEN__) VENDOR_REQUESTS_PARAMS_DEC_ diff --git a/lib_xua/src/core/clocking/clockgen.xc b/lib_xua/src/core/clocking/clockgen.xc index 289cf754..1c0a3334 100644 --- a/lib_xua/src/core/clocking/clockgen.xc +++ b/lib_xua/src/core/clocking/clockgen.xc @@ -53,7 +53,7 @@ void PllRefPinTask(server interface pll_ref_if i_pll_ref, out port p_pll_ref) pinVal = ~pinVal; p_pll_ref <: pinVal; break; - + case i_pll_ref.init(): p_pll_ref <: pinVal @ pinTime; pinTime += (unsigned short)(LOCAL_CLOCK_INCREMENT - (LOCAL_CLOCK_INCREMENT/2)); @@ -61,9 +61,9 @@ void PllRefPinTask(server interface pll_ref_if i_pll_ref, out port p_pll_ref) break; case i_pll_ref.toggle_timed(int relative): - + if (!relative) - { + { pinTime += (short) LOCAL_CLOCK_INCREMENT; pinVal = !pinVal; p_pll_ref @ pinTime <: pinVal; @@ -353,7 +353,7 @@ void clockGen (streaming chanend ?c_spdif_rx, chanend ?c_adat_rx, client interfa /* Initial ref clock output and get timestamp */ i_pll_ref.init(); - + while(1) { select @@ -485,8 +485,8 @@ void clockGen (streaming chanend ?c_spdif_rx, chanend ?c_adat_rx, client interfa timeNextClockDetection = timeNextEdge + (LOCAL_CLOCK_INCREMENT/2); timeNextEdge += LOCAL_CLOCK_INCREMENT; - /* If we are in an external clock mode and this fire, then clock invalid - * reset counters in case we are moved to digital clock - we want a well timed + /* If we are in an external clock mode and this fire, then clock invalid + * reset counters in case we are moved to digital clock - we want a well timed * first edge */ #if (XUA_SPDIF_RX_EN) spdifCounters.receivedSamples = 0; @@ -707,7 +707,7 @@ void clockGen (streaming chanend ?c_spdif_rx, chanend ?c_adat_rx, client interfa /* Toggle edge */ i_pll_ref.toggle_timed(1); - + /* Reset counters */ adatCounters.receivedSamples = 0; diff --git a/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h b/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h index c4ddcbe4..622ffcf2 100644 --- a/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h +++ b/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h @@ -46,7 +46,7 @@ #define ISO_EP_ATTRIBUTES_ASYNC ((USB_ENDPOINT_TRANSTYPE_ISO << USB_ENDPOINT_TRANSTYPE_SHIFT)\ | (USB_ENDPOINT_SYNCTYPE_ASYNC << USB_ENDPOINT_SYNCTYPE_SHIFT)\ | (USB_ENDPOINT_USAGETYPE_DATA << USB_ENDPOINT_USAGETYPE_SHIFT)) - + #define ISO_EP_ATTRIBUTES_ADAPTIVE ((USB_ENDPOINT_TRANSTYPE_ISO << USB_ENDPOINT_TRANSTYPE_SHIFT)\ | (USB_ENDPOINT_SYNCTYPE_ADAPT << USB_ENDPOINT_SYNCTYPE_SHIFT)\ | (USB_ENDPOINT_USAGETYPE_DATA << USB_ENDPOINT_USAGETYPE_SHIFT)) @@ -1486,7 +1486,7 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2= #elif (XUA_SYNCMODE == XUA_SYNCMODE_SYNC) .bmAttributes = ISO_EP_ATTRIBUTES_SYNC, #else - #error "Bad XUA_SYNCMODE" + #error "Bad XUA_SYNCMODE" #endif .wMaxPacketSize = HS_STREAM_FORMAT_OUTPUT_1_MAXPACKETSIZE, .bInterval = 1, diff --git a/lib_xua/src/core/main.xc b/lib_xua/src/core/main.xc index c2a14fed..86ef35d8 100755 --- a/lib_xua/src/core/main.xc +++ b/lib_xua/src/core/main.xc @@ -311,7 +311,7 @@ VENDOR_REQUESTS_PARAMS_DEC_ unsigned usbSpeed = (AUDIO_CLASS == 2) ? XUD_SPEED_HS : XUD_SPEED_FS; unsigned xudPwrCfg = (XUA_POWERMODE == XUA_POWERMODE_SELF) ? XUD_PWR_SELF : XUD_PWR_BUS; - + /* USB interface core */ XUD_Main(c_xud_out, ENDPOINT_COUNT_OUT, c_xud_in, ENDPOINT_COUNT_IN, c_sof, epTypeTableOut, epTypeTableIn, usbSpeed, xudPwrCfg); @@ -491,8 +491,8 @@ void usb_audio_io(chanend ?c_aud_in, #if (XUA_SPDIF_RX_EN || XUA_ADAT_RX_EN) { - /* ClockGen must currently run on same tile as AudioHub due to shared memory buffer - * However, due to the use of an interface the pll reference signal port can be on another tile + /* ClockGen must currently run on same tile as AudioHub due to shared memory buffer + * However, due to the use of an interface the pll reference signal port can be on another tile */ thread_speed(); clockGen(c_spdif_rx, c_adat_rx, i_pll_ref, c_dig_rx, c_clk_ctl, c_clk_int); diff --git a/tests/test_sync_clk_basic/src/main.xc b/tests/test_sync_clk_basic/src/main.xc index 6a7531e8..d6c5b519 100644 --- a/tests/test_sync_clk_basic/src/main.xc +++ b/tests/test_sync_clk_basic/src/main.xc @@ -2,8 +2,8 @@ // This Software is subject to the terms of the XMOS Public Licence: Version 1. /* Simple test to ensure reference clock to CS2100 device continues when SOF clock not available - * Note, this test uses "nice" numbers (i.e. MISSIG_SOFS %8 == 0) and therefore doesn't check - * for a graceful change over from internal to SOF clock + * Note, this test uses "nice" numbers (i.e. MISSIG_SOFS %8 == 0) and therefore doesn't check + * for a graceful change over from internal to SOF clock */ #include "platform.h" @@ -14,7 +14,7 @@ #define EP_COUNT_IN (3) #define EP_COUNT_OUT (3) -out port p_pll_ref = XS1_PORT_1A; +out port p_pll_ref = XS1_PORT_1A; in port p_off_mclk = XS1_PORT_1M; in port p_pll_loop = XS1_PORT_1B; /* Note, this is externally looped back using the loopback plugin */ @@ -49,7 +49,7 @@ void delay(unsigned d) unsigned time; t :> time; t when timerafter(time + d) :> int x; -} +} /* From lib_xud */ void SetupEndpoints(chanend c_ep_out[], int noEpOut, chanend c_ep_in[], int noEpIn, XUD_EpType epTypeTableOut[], XUD_EpType epTypeTableIn[]); @@ -80,41 +80,41 @@ void fake_xud(chanend c_out[], chanend c_in[], chanend c_sof) { timer t; unsigned time; - - /* Makes traces a bit nicer to look at */ + + /* Makes traces a bit nicer to look at */ t :> time; t when timerafter(SOF_PERIOD_TICKS * 2) :> int x; - + p_test0 <: 1; - + /* Endpoint type tables */ XUD_EpType epTypeTableOut[EP_COUNT_OUT] = {XUD_EPTYPE_CTL, XUD_EPTYPE_ISO, XUD_EPTYPE_DIS}; XUD_EpType epTypeTableIn[EP_COUNT_IN] = {XUD_EPTYPE_CTL, XUD_EPTYPE_ISO, XUD_EPTYPE_ISO}; - + SetupEndpoints(c_out, EP_COUNT_OUT, c_in, EP_COUNT_IN, epTypeTableOut, epTypeTableIn); driveSofs(c_sof, 32/SOF_DIVIDE); - + p_test0 <: 0; - - /* Sim missing SOFs */ + + /* Sim missing SOFs */ delay(MISSING_SOF_PERIOD); - + p_test0 <: 1; - + driveSofs(c_sof, 16/SOF_DIVIDE); - + p_test0 <: 0; - + delay(MISSING_SOF_PERIOD); - + p_test0 <: 1; - + driveSofs(c_sof, 16/SOF_DIVIDE); - + p_test0 <: 0; - + } extern XUD_BusSpeed_t g_curUsbSpeed; @@ -124,7 +124,7 @@ extern XUD_BusSpeed_t g_curUsbSpeed; void checker() { - timer t; + timer t; unsigned t0, t1; unsigned x = 0; int fail = 0; @@ -141,7 +141,7 @@ void checker() t :> t0; p_pll_loop when pinsneq(x) :> x; t :> t1; - + int period = t1-t0; /* Check the period of the reference clock we are generating */ @@ -190,7 +190,7 @@ int main() } fake_xud(c_out, c_in, c_sof); - + checker(); } } diff --git a/tests/test_sync_clk_basic/src/xua_conf.h b/tests/test_sync_clk_basic/src/xua_conf.h index 616262b7..b5bc7ef7 100644 --- a/tests/test_sync_clk_basic/src/xua_conf.h +++ b/tests/test_sync_clk_basic/src/xua_conf.h @@ -9,7 +9,7 @@ #define I2S_CHANS_ADC (2) #define XUA_SYNCMODE XUA_SYNCMODE_SYNC -#define UAC_FORCE_FEEDBACK_EP (0) +#define UAC_FORCE_FEEDBACK_EP (0) #define EXCLUDE_USB_AUDIO_MAIN #define XUA_NUM_PDM_MICS 0 diff --git a/tests/test_sync_clk_plugin/src/xua_conf.h b/tests/test_sync_clk_plugin/src/xua_conf.h index 616262b7..b5bc7ef7 100644 --- a/tests/test_sync_clk_plugin/src/xua_conf.h +++ b/tests/test_sync_clk_plugin/src/xua_conf.h @@ -9,7 +9,7 @@ #define I2S_CHANS_ADC (2) #define XUA_SYNCMODE XUA_SYNCMODE_SYNC -#define UAC_FORCE_FEEDBACK_EP (0) +#define UAC_FORCE_FEEDBACK_EP (0) #define EXCLUDE_USB_AUDIO_MAIN #define XUA_NUM_PDM_MICS 0