forked from PAWPAW-Mirror/lib_xua
xpd: Cleaned up whitespace
This commit is contained in:
@@ -317,7 +317,7 @@ static inline void InitPorts(unsigned divide)
|
|||||||
#endif
|
#endif
|
||||||
/* Pre-fill the LR clock output port */
|
/* Pre-fill the LR clock output port */
|
||||||
p_lrclk <: 0x0;
|
p_lrclk <: 0x0;
|
||||||
|
|
||||||
doI2SClocks(divide);
|
doI2SClocks(divide);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -407,7 +407,7 @@ chanend ?c_adc)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
unsigned command = DoSampleTransfer(c_out, readBuffNo, underflowWord);
|
unsigned command = DoSampleTransfer(c_out, readBuffNo, underflowWord);
|
||||||
|
|
||||||
if(command)
|
if(command)
|
||||||
{
|
{
|
||||||
@@ -554,7 +554,7 @@ chanend ?c_adc)
|
|||||||
p_i2s_dac[index++] <: bitrev(samplesOut[(frameCount)+i]);
|
p_i2s_dac[index++] <: bitrev(samplesOut[(frameCount)+i]);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* 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);
|
||||||
|
|
||||||
@@ -564,7 +564,7 @@ chanend ?c_adc)
|
|||||||
/* First input (i.e. frameCoint == 0) we read last ADC channel of previous frame.. */
|
/* First input (i.e. frameCoint == 0) we read last ADC channel of previous frame.. */
|
||||||
unsigned buffIndex = frameCount ? !readBuffNo : readBuffNo;
|
unsigned buffIndex = frameCount ? !readBuffNo : readBuffNo;
|
||||||
|
|
||||||
#pragma loop unroll
|
#pragma loop unroll
|
||||||
/* First time around we get channel 7 of TDM8 */
|
/* First time around we get channel 7 of TDM8 */
|
||||||
for(int i = 0; i < I2S_CHANS_ADC; i+=I2S_CHANS_PER_FRAME)
|
for(int i = 0; i < I2S_CHANS_ADC; i+=I2S_CHANS_PER_FRAME)
|
||||||
{
|
{
|
||||||
@@ -582,7 +582,7 @@ chanend ?c_adc)
|
|||||||
|
|
||||||
if(frameCount == 0)
|
if(frameCount == 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
#if defined(SPDIF_RX) || defined(ADAT_RX)
|
#if defined(SPDIF_RX) || defined(ADAT_RX)
|
||||||
/* Sync with clockgen */
|
/* Sync with clockgen */
|
||||||
inuint(c_dig_rx);
|
inuint(c_dig_rx);
|
||||||
@@ -649,9 +649,9 @@ chanend ?c_adc)
|
|||||||
/* Manual IN instruction since compiler generates an extra setc per IN (bug #15256) */
|
/* Manual IN instruction since compiler generates an extra setc per IN (bug #15256) */
|
||||||
asm volatile("in %0, res[%1]" : "=r"(sample) : "r"(p_i2s_adc[index++]));
|
asm volatile("in %0, res[%1]" : "=r"(sample) : "r"(p_i2s_adc[index++]));
|
||||||
if(readBuffNo)
|
if(readBuffNo)
|
||||||
samplesIn_0[frameCount+i] = bitrev(sample);
|
samplesIn_0[frameCount+i] = bitrev(sample);
|
||||||
else
|
else
|
||||||
samplesIn_1[frameCount+i] = bitrev(sample);
|
samplesIn_1[frameCount+i] = bitrev(sample);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SU1_ADC_ENABLE
|
#ifdef SU1_ADC_ENABLE
|
||||||
@@ -710,7 +710,7 @@ chanend ?c_adc)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef I2S_MODE_TDM
|
#ifdef I2S_MODE_TDM
|
||||||
/* Increase frameCount by 2 since we have output two channels (per data line) */
|
/* Increase frameCount by 2 since we have output two channels (per data line) */
|
||||||
frameCount+=2;
|
frameCount+=2;
|
||||||
@@ -721,16 +721,16 @@ chanend ?c_adc)
|
|||||||
/* The below looks a bit odd but forces the compiler to inline twice */
|
/* The below looks a bit odd but forces the compiler to inline twice */
|
||||||
unsigned command;
|
unsigned command;
|
||||||
if(readBuffNo)
|
if(readBuffNo)
|
||||||
command = DoSampleTransfer(c_out, 1, underflowWord);
|
command = DoSampleTransfer(c_out, 1, underflowWord);
|
||||||
else
|
else
|
||||||
command = DoSampleTransfer(c_out, 0, underflowWord);
|
command = DoSampleTransfer(c_out, 0, underflowWord);
|
||||||
|
|
||||||
|
|
||||||
if(command)
|
if(command)
|
||||||
{
|
{
|
||||||
return command;
|
return command;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Reset frame counter and flip the ADC buffer */
|
/* Reset frame counter and flip the ADC buffer */
|
||||||
frameCount = 0;
|
frameCount = 0;
|
||||||
readBuffNo = !readBuffNo;
|
readBuffNo = !readBuffNo;
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ static inline void GiveSamplesToHost(chanend c, xc_ptr ptr, xc_ptr multIn)
|
|||||||
{
|
{
|
||||||
int sample;
|
int sample;
|
||||||
int index;
|
int index;
|
||||||
|
|
||||||
#if MAX_MIX_COUNT > 0
|
#if MAX_MIX_COUNT > 0
|
||||||
read_via_xc_ptr_indexed(index,ptr,i);
|
read_via_xc_ptr_indexed(index,ptr,i);
|
||||||
#else
|
#else
|
||||||
@@ -239,7 +239,7 @@ static inline void GetSamplesFromHost(chanend c, unsigned underflow)
|
|||||||
#else
|
#else
|
||||||
ptr_samples[i] = sample;
|
ptr_samples[i] = sample;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -263,10 +263,10 @@ static inline void GiveSamplesToDevice(chanend c, xc_ptr ptr, xc_ptr multOut, un
|
|||||||
|
|
||||||
#if MAX_MIX_COUNT > 0
|
#if MAX_MIX_COUNT > 0
|
||||||
/* If mixer turned on sort out the channel mapping */
|
/* If mixer turned on sort out the channel mapping */
|
||||||
|
|
||||||
/* Read pointer to sample from the map */
|
/* Read pointer to sample from the map */
|
||||||
read_via_xc_ptr_indexed(index, ptr, i);
|
read_via_xc_ptr_indexed(index, ptr, i);
|
||||||
|
|
||||||
/* Read the actual sample value */
|
/* Read the actual sample value */
|
||||||
read_via_xc_ptr_indexed(sample, samples, index);
|
read_via_xc_ptr_indexed(sample, samples, index);
|
||||||
#else
|
#else
|
||||||
@@ -340,7 +340,7 @@ static inline void GetSamplesFromDevice(chanend c)
|
|||||||
{
|
{
|
||||||
ptr_samples[NUM_USB_CHAN_OUT + i] = sample;
|
ptr_samples[NUM_USB_CHAN_OUT + i] = sample;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -361,13 +361,13 @@ static void mixer1(chanend c_host, chanend c_mix_ctl, chanend c_mixer2)
|
|||||||
#pragma xta endpoint "mixer1_req"
|
#pragma xta endpoint "mixer1_req"
|
||||||
/* Request from audio() */
|
/* Request from audio() */
|
||||||
inuint(c_mixer2);
|
inuint(c_mixer2);
|
||||||
|
|
||||||
GiveSamplesToDevice(c_mixer2, samples_to_device_map, multOut, underflow);
|
GiveSamplesToDevice(c_mixer2, samples_to_device_map, multOut, underflow);
|
||||||
GetSamplesFromDevice(c_mixer2);
|
GetSamplesFromDevice(c_mixer2);
|
||||||
|
|
||||||
/* Request data from decouple thread */
|
/* Request data from decouple thread */
|
||||||
outuint(c_host, 0);
|
outuint(c_host, 0);
|
||||||
|
|
||||||
/* Between request to decouple and respose ~ 400nS latency for interrupt to fire */
|
/* Between request to decouple and respose ~ 400nS latency for interrupt to fire */
|
||||||
select
|
select
|
||||||
{
|
{
|
||||||
@@ -611,7 +611,7 @@ static void mixer1(chanend c_host, chanend c_mix_ctl, chanend c_mixer2)
|
|||||||
}
|
}
|
||||||
#else /* IF MAX_MIX_COUNT > 0 */
|
#else /* IF MAX_MIX_COUNT > 0 */
|
||||||
/* No mixes, this thread runs on its own doing just volume */
|
/* No mixes, this thread runs on its own doing just volume */
|
||||||
|
|
||||||
GiveSamplesToHost(c_host, samples_to_host_map, multIn);
|
GiveSamplesToHost(c_host, samples_to_host_map, multIn);
|
||||||
GetSamplesFromHost(c_host, underflow);
|
GetSamplesFromHost(c_host, underflow);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user