forked from PAWPAW-Mirror/lib_xua
xpd: Cleaned up whitespace
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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__)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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_
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user