xpd: Cleaned up whitespace

This commit is contained in:
Ross Owen
2015-03-04 16:10:04 +00:00
parent a28fccdcb7
commit 6eaa986eb9
3 changed files with 1523 additions and 1523 deletions

View File

@@ -172,7 +172,7 @@ static inline void TransferAdatTxSamples(chanend c_adat_out, const unsigned samp
unsafe unsafe
{ {
unsigned * unsafe samplesFromHostAdat = &samplesFromHost[ADAT_TX_INDEX]; unsigned * unsafe samplesFromHostAdat = &samplesFromHost[ADAT_TX_INDEX];
/* Note, when smux == 1 this loop just does a straight 1:1 copy */ /* Note, when smux == 1 this loop just does a straight 1:1 copy */
//if(smux != 1) //if(smux != 1)
{ {
@@ -181,31 +181,31 @@ static inline void TransferAdatTxSamples(chanend c_adat_out, const unsigned samp
{ {
adatSamples[adatSampleIndex] = samplesFromHostAdat[i]; adatSamples[adatSampleIndex] = samplesFromHostAdat[i];
adatSampleIndex += smux; adatSampleIndex += smux;
} }
} }
} }
adatCounter++; adatCounter++;
if(adatCounter == smux) if(adatCounter == smux)
{ {
#ifdef ADAT_TX_USE_SHARED_BUFF #ifdef ADAT_TX_USE_SHARED_BUFF
unsafe unsafe
{ {
/* Wait for ADAT core to be done with buffer */ /* Wait for ADAT core to be done with buffer */
/* Note, we are "running ahead" of the ADAT core */ /* Note, we are "running ahead" of the ADAT core */
inuint(c_adat_out); inuint(c_adat_out);
/* Send buffer pointer over to ADAT core */ /* Send buffer pointer over to ADAT core */
volatile unsigned * unsafe samplePtr = &adatSamples; volatile unsigned * unsafe samplePtr = &adatSamples;
outuint(c_adat_out, (unsigned) samplePtr); outuint(c_adat_out, (unsigned) samplePtr);
} }
#else #else
#pragma loop unroll #pragma loop unroll
for (int i = 0; i < 8; i++) for (int i = 0; i < 8; i++)
{ {
outuint(c_adat_out, samplesFromHost[ADAT_TX_INDEX + i]); outuint(c_adat_out, samplesFromHost[ADAT_TX_INDEX + i]);
} }
#endif #endif
adatCounter = 0; adatCounter = 0;
@@ -411,8 +411,8 @@ static inline void InitPorts(unsigned divide)
p_lrclk when pinseq(1) :> void @ tmp; p_lrclk when pinseq(1) :> void @ tmp;
#else #else
p_lrclk when pinseq(0) :> void @ tmp; p_lrclk when pinseq(0) :> void @ tmp;
#endif #endif
tmp += (I2S_CHANS_PER_FRAME * 32) - 32 + 1 ; tmp += (I2S_CHANS_PER_FRAME * 32) - 32 + 1 ;
/* E.g. 2 * 32 - 32 + 1 = 33 for stereo */ /* E.g. 2 * 32 - 32 + 1 = 33 for stereo */
/* E..g 8 * 32 - 32 + 1 = 225 for 8 chan TDM */ /* E..g 8 * 32 - 32 + 1 = 225 for 8 chan TDM */
@@ -439,10 +439,10 @@ static inline void InitPorts(unsigned divide)
/* I2S delivery thread */ /* I2S delivery thread */
#pragma unsafe arrays #pragma unsafe arrays
unsigned static deliver(chanend c_out, chanend ?c_spd_out, unsigned static deliver(chanend c_out, chanend ?c_spd_out,
#ifdef ADAT_TX #ifdef ADAT_TX
chanend c_adat_out, chanend c_adat_out,
unsigned adatSmuxMode, unsigned adatSmuxMode,
#endif #endif
unsigned divide, unsigned curSamFreq, unsigned divide, unsigned curSamFreq,
#if(defined(SPDIF_RX) || defined(ADAT_RX)) #if(defined(SPDIF_RX) || defined(ADAT_RX))
@@ -495,17 +495,17 @@ unsigned static deliver(chanend c_out, chanend ?c_spd_out,
unsigned command = DoSampleTransfer(c_out, readBuffNo, underflowWord); unsigned command = DoSampleTransfer(c_out, readBuffNo, underflowWord);
#ifdef ADAT_TX #ifdef ADAT_TX
unsafe{ unsafe{
//TransferAdatTxSamples(c_adat_out, samplesOut, adatSmuxMode, 0); //TransferAdatTxSamples(c_adat_out, samplesOut, adatSmuxMode, 0);
volatile unsigned * unsafe samplePtr = &samplesOut[ADAT_TX_INDEX]; volatile unsigned * unsafe samplePtr = &samplesOut[ADAT_TX_INDEX];
outuint(c_adat_out, (unsigned) samplePtr); outuint(c_adat_out, (unsigned) samplePtr);
} }
#endif #endif
if(command) if(command)
{ {
return command; return command;
} }
InitPorts(divide); InitPorts(divide);
/* TODO In master mode, the i/o loop assumes L/RCLK = 32bit clocks. We should check this every interation /* TODO In master mode, the i/o loop assumes L/RCLK = 32bit clocks. We should check this every interation
@@ -650,9 +650,9 @@ unsigned static deliver(chanend c_out, chanend ?c_spd_out,
/* Clock out the LR Clock, the DAC data and Clock in the next sample into ADC */ /* Clock out the LR Clock, the DAC data and Clock in the next sample into ADC */
doI2SClocks(divide); doI2SClocks(divide);
#endif #endif
#if (I2S_CHANS_ADC != 0) #if (I2S_CHANS_ADC != 0)
/* Input previous L sample into L in buffer */ /* Input previous L sample into L in buffer */
@@ -675,10 +675,10 @@ unsigned static deliver(chanend c_out, chanend ?c_spd_out,
samplesIn_0[((frameCount-1)&(I2S_CHANS_PER_FRAME-1))+i] = bitrev(sample); // channels 1, 3, 5.. on each line. samplesIn_0[((frameCount-1)&(I2S_CHANS_PER_FRAME-1))+i] = bitrev(sample); // channels 1, 3, 5.. on each line.
} }
#endif #endif
#ifdef ADAT_TX #ifdef ADAT_TX
TransferAdatTxSamples(c_adat_out, samplesOut, adatSmuxMode, 1); TransferAdatTxSamples(c_adat_out, samplesOut, adatSmuxMode, 1);
#endif #endif
if(frameCount == 0) if(frameCount == 0)
{ {
@@ -741,7 +741,7 @@ unsigned static deliver(chanend c_out, chanend ?c_spd_out,
#ifndef CODEC_MASTER #ifndef CODEC_MASTER
doI2SClocks(divide); doI2SClocks(divide);
#endif #endif
#if (I2S_CHANS_ADC != 0) #if (I2S_CHANS_ADC != 0)
index = 0; index = 0;
/* Channels 0, 2, 4.. on each line */ /* Channels 0, 2, 4.. on each line */
@@ -988,19 +988,19 @@ chanend ?c_config, chanend ?c)
if ((MCLK_441 % curSamFreq) == 0) if ((MCLK_441 % curSamFreq) == 0)
{ {
mClk = MCLK_441; mClk = MCLK_441;
#ifdef ADAT_TX #ifdef ADAT_TX
/* Calculate ADAT SMUX mode (1, 2, 4) */ /* Calculate ADAT SMUX mode (1, 2, 4) */
adatSmuxMode = curSamFreq / 44100; adatSmuxMode = curSamFreq / 44100;
adatMultiple = mClk / 44100; adatMultiple = mClk / 44100;
#endif #endif
} }
else if ((MCLK_48 % curSamFreq) == 0) else if ((MCLK_48 % curSamFreq) == 0)
{ {
mClk = MCLK_48; mClk = MCLK_48;
#ifdef ADAT_TX #ifdef ADAT_TX
/* Calculate ADAT SMUX mode (1, 2, 4) */ /* Calculate ADAT SMUX mode (1, 2, 4) */
adatSmuxMode = curSamFreq / 48000; adatSmuxMode = curSamFreq / 48000;
adatMultiple = mClk / 48000; adatMultiple = mClk / 48000;
#endif #endif
} }
@@ -1161,7 +1161,7 @@ chanend ?c_config, chanend ?c)
#endif #endif
#ifdef ADAT_TX #ifdef ADAT_TX
c_adat_out, c_adat_out,
adatSmuxMode, adatSmuxMode,
#endif #endif
divide, curSamFreq, divide, curSamFreq,
#if defined (ADAT_RX) || defined (SPDIF_RX) #if defined (ADAT_RX) || defined (SPDIF_RX)

File diff suppressed because it is too large Load Diff

View File

@@ -4,7 +4,7 @@
#include "xud.h" /* XMOS USB Device Layer defines and functions */ #include "xud.h" /* XMOS USB Device Layer defines and functions */
#if (XUD_SERIES_SUPPORT != XUD_U_SERIES) #if (XUD_SERIES_SUPPORT != XUD_U_SERIES)
/* XUD_L_SERIES and XUD_G_SERIES */ /* XUD_L_SERIES and XUD_G_SERIES */
@@ -31,7 +31,7 @@
/* #define CLKBLK_MCLK XS1_CLKBLK_2 */ /* #define CLKBLK_MCLK XS1_CLKBLK_2 */
#define CLKBLK_I2S_BIT XS1_CLKBLK_3 #define CLKBLK_I2S_BIT XS1_CLKBLK_3
#else #else
/* XUD_U_SERIES */ /* XUD_U_SERIES */