xpd: Cleaned up whitespace

This commit is contained in:
Ross Owen
2015-12-02 22:30:43 +00:00
parent ee6dd02faa
commit 176cbeae28
9 changed files with 71 additions and 71 deletions

View File

@@ -26,7 +26,7 @@ void audio(chanend c_in,
#if (XUD_TILE != 0)
, server interface i_dfu dfuInterface
#endif
#if (NUM_PDM_MICS > 0)
#if (NUM_PDM_MICS > 0)
, chanend c_pdm_in
#endif
);

View File

@@ -705,14 +705,14 @@ unsigned static deliver(chanend c_out, chanend ?c_spd_out,
#endif
#if (NUM_PDM_MICS > 0)
/* Get samples from PDM->PCM comverter */
/* Get samples from PDM->PCM comverter */
c_pdm_pcm <: 1;
#pragma loop unroll
for(int i = 0; i < NUM_PDM_MICS; i++)
{
c_pdm_pcm :> samplesIn_0[i];
}
#endif
#endif
}
@@ -1190,7 +1190,7 @@ chanend ?c_config, chanend ?c
#if NUM_PDM_MICS > 0
/* Send decimation factor to PDM task(s) */
c_pdm_in <: curSamFreq;
c_pdm_in <: curSamFreq;
#endif
#ifdef ADAT_TX

View File

@@ -123,7 +123,7 @@ unsafe
{
unsigned * unsafe curSamFreqMultiplier = &g_curSamFreqMultiplier;
static void setG_curSamFreqMultiplier(unsigned x)
static void setG_curSamFreqMultiplier(unsigned x)
{
// asm(" stw %0, dp[g_curSamFreqMultiplier]" :: "r"(x));
*curSamFreqMultiplier = x;
@@ -337,7 +337,7 @@ int AudioClassRequests_2(XUD_ep ep0_out, XUD_ep ep0_in, USB_SetupPacket_t &sp, c
}
setG_curSamFreqMultiplier(g_curSamFreq/(newMasterClock/512));
#endif
#endif
#ifdef ADAT_RX
/* Configure ADAT SMUX based on sample rate */
outuint(c_clk_ctl, SET_SMUX);
@@ -875,7 +875,7 @@ int AudioClassRequests_2(XUD_ep ep0_out, XUD_ep ep0_in, USB_SetupPacket_t &sp, c
#endif
/* Special case for some low sample rates */
unsigned lowSampleRateList[] = {8000, 11025, 12000, 16000, 32000};
for (int k = 0; k < sizeof(lowSampleRateList)/sizeof(unsigned); k++)
{
if((lowSampleRateList[k] >= MIN_FREQ) && (lowSampleRateList[k] <= MAX_FREQ))
@@ -884,7 +884,7 @@ int AudioClassRequests_2(XUD_ep ep0_out, XUD_ep ep0_in, USB_SetupPacket_t &sp, c
num_freqs++;
}
}
/* Just keep doubling for standard freqs >= 44.1/48kHz */
currentFreq44 = 44100;
currentFreq48 = 48000;
@@ -917,7 +917,7 @@ int AudioClassRequests_2(XUD_ep ep0_out, XUD_ep ep0_in, USB_SetupPacket_t &sp, c
num_freqs++;
}
#endif
storeShort(buffer, 0, num_freqs);
return XUD_DoGetRequest(ep0_out, ep0_in, buffer, i, sp.wLength);

View File

@@ -2208,38 +2208,38 @@ unsigned char cfgDesc_Null[] =
#define AC_LENGTH (8 + INPUT_INTERFACES_A1 + OUTPUT_INTERFACES_A1)
/* In UAC1 supported sample rates are listed in descriptor
/* In UAC1 supported sample rates are listed in descriptor
* Note, using a value of <=2 or > 7 for num_freqs_a1 causes enumeration issues on Windows.
* To work around this we repeat MAX_FREQ_FS multiple times in some cases */
#define MAX(a,b) (((a)>(b))?(a):(b))
const unsigned num_freqs_a1 = MAX(3, (0
#if(MIN_FREQ <= 8000) && (MAX_FREQ_FS >= 8000)
#if(MIN_FREQ <= 8000) && (MAX_FREQ_FS >= 8000)
+ 1
#endif
#if(MIN_FREQ <= 11025) && (MAX_FREQ_FS >= 11025)
#if(MIN_FREQ <= 11025) && (MAX_FREQ_FS >= 11025)
+1
#endif
#if(MIN_FREQ <= 12000) && (MAX_FREQ_FS >= 12000)
#if(MIN_FREQ <= 12000) && (MAX_FREQ_FS >= 12000)
+1
#endif
#if(MIN_FREQ <= 16000) && (MAX_FREQ_FS >= 16000)
#if(MIN_FREQ <= 16000) && (MAX_FREQ_FS >= 16000)
+1
#endif
#if(MIN_FREQ <= 32000) && (MAX_FREQ_FS >= 32000)
#if(MIN_FREQ <= 32000) && (MAX_FREQ_FS >= 32000)
+1
#endif
#if (MIN_FREQ <= 44100) && (MAX_FREQ_FS >= 44100)
#if (MIN_FREQ <= 44100) && (MAX_FREQ_FS >= 44100)
+1
#endif
#if (MIN_FREQ <= 48000) && (MAX_FREQ_FS >= 48000)
#if (MIN_FREQ <= 48000) && (MAX_FREQ_FS >= 48000)
+1
#endif
#if (MIN_FREQ <= 88200) && (MAX_FREQ_FS >= 88200)
#if (MIN_FREQ <= 88200) && (MAX_FREQ_FS >= 88200)
+1
#endif
#if (MIN_FREQ <= 96000) && (MAX_FREQ_FS >= 96000)
#if (MIN_FREQ <= 96000) && (MAX_FREQ_FS >= 96000)
+1
#endif
));
@@ -2260,7 +2260,7 @@ const unsigned num_freqs_a1 = MAX(3, (0
#define CHARIFY_SR(x) (x & 0xff),((x & 0xff00)>> 8),((x & 0xff0000)>> 16)
#if (MIN_FREQ_FS < 12000) && (MAX_FREQ_FS > 48000)
#error SAMPLE RATE RANGE TO GREAT FOR UAC1 ON WINDOWS
#error SAMPLE RATE RANGE TO GREAT FOR UAC1 ON WINDOWS
#endif
unsigned char cfgDesc_Audio1[] =
@@ -2431,47 +2431,47 @@ unsigned char cfgDesc_Audio1[] =
|| (MIN_FREQ == 16000) && (MAX_FREQ_FS == 32000) \
|| (MIN_FREQ == 44100) && (MAX_FREQ_FS == 48000) \
|| (MIN_FREQ == 48000) && (MAX_FREQ_FS == 88200) \
|| (MIN_FREQ == 88200) && (MAX_FREQ_FS == 96000)
CHARIFY_SR(MAX_FREQ_FS),
|| (MIN_FREQ == 88200) && (MAX_FREQ_FS == 96000)
CHARIFY_SR(MAX_FREQ_FS),
#endif
#if (MIN_FREQ == MAX_FREQ_FS)
CHARIFY_SR(MAX_FREQ_FS),
CHARIFY_SR(MAX_FREQ_FS),
CHARIFY_SR(MAX_FREQ_FS),
CHARIFY_SR(MAX_FREQ_FS),
#endif
#if(MIN_FREQ <= 8000) && (MAX_FREQ_FS >= 8000)
#if(MIN_FREQ <= 8000) && (MAX_FREQ_FS >= 8000)
0x40, 0x1F, 0x00, /* sampleFreq - 8KHz */
#endif
#if(MIN_FREQ <= 11025) && (MAX_FREQ_FS >= 11025)
#if(MIN_FREQ <= 11025) && (MAX_FREQ_FS >= 11025)
0x11, 0x2B, 0x00, /* sampleFreq - 11.25KHz */
#endif
#if(MIN_FREQ <= 12000) && (MAX_FREQ_FS >= 12000)
#if(MIN_FREQ <= 12000) && (MAX_FREQ_FS >= 12000)
0xE0, 0x2E, 0x00, /* sampleFreq - 12KHz */
#endif
#if(MIN_FREQ <= 16000) && (MAX_FREQ_FS >= 16000)
#if(MIN_FREQ <= 16000) && (MAX_FREQ_FS >= 16000)
CHARIFY_SR(16000), /* sampleFreq - 16KHz */
#endif
#if(MIN_FREQ <= 32000) && (MAX_FREQ_FS >= 32000)
#if(MIN_FREQ <= 32000) && (MAX_FREQ_FS >= 32000)
CHARIFY_SR(32000), /* sampleFreq - 32KHz */
#endif
#if (MIN_FREQ <= 44100) && (MAX_FREQ_FS >= 44100)
#if (MIN_FREQ <= 44100) && (MAX_FREQ_FS >= 44100)
0x44, 0xAC, 0x00, /* sampleFreq - 44.1Khz */
#endif
#if (MIN_FREQ <= 48000) && (MAX_FREQ_FS >= 48000)
#if (MIN_FREQ <= 48000) && (MAX_FREQ_FS >= 48000)
0x80, 0xBB, 0x00, /* sampleFreq - 48KHz */
#endif
#if (MIN_FREQ <= 88200) && (MAX_FREQ_FS >= 88200)
#if (MIN_FREQ <= 88200) && (MAX_FREQ_FS >= 88200)
0x88, 0x58, 0x01, /* sampleFreq - 88.2KHz */
#endif
#if (MIN_FREQ <= 96000) && (MAX_FREQ_FS >= 96000)
#if (MIN_FREQ <= 96000) && (MAX_FREQ_FS >= 96000)
0x00, 0x77, 0x01, /* sampleFreq - 96KHz */
#endif
@@ -2559,50 +2559,50 @@ unsigned char cfgDesc_Audio1[] =
|| (MIN_FREQ == 16000) && (MAX_FREQ_FS == 32000) \
|| (MIN_FREQ == 44100) && (MAX_FREQ_FS == 48000) \
|| (MIN_FREQ == 48000) && (MAX_FREQ_FS == 88200) \
|| (MIN_FREQ == 88200) && (MAX_FREQ_FS == 96000)
CHARIFY_SR(MAX_FREQ_FS),
|| (MIN_FREQ == 88200) && (MAX_FREQ_FS == 96000)
CHARIFY_SR(MAX_FREQ_FS),
#endif
#if (MIN_FREQ == MAX_FREQ_FS)
CHARIFY_SR(MAX_FREQ_FS),
CHARIFY_SR(MAX_FREQ_FS),
CHARIFY_SR(MAX_FREQ_FS),
CHARIFY_SR(MAX_FREQ_FS),
#endif
#if(MIN_FREQ <= 8000) && (MAX_FREQ_FS >= 8000)
#if(MIN_FREQ <= 8000) && (MAX_FREQ_FS >= 8000)
0x40, 0x1F, 0x00, /* sampleFreq - 8000KHz */
#endif
#if(MIN_FREQ <= 11025) && (MAX_FREQ_FS >= 11025)
#if(MIN_FREQ <= 11025) && (MAX_FREQ_FS >= 11025)
0x11, 0x2B, 0x00, /* sampleFreq - 11025KHz */
#endif
#if(MIN_FREQ <= 12000) && (MAX_FREQ_FS >= 12000)
#if(MIN_FREQ <= 12000) && (MAX_FREQ_FS >= 12000)
0xE0, 0x2E, 0x00, /* sampleFreq - 12000KHz */
#endif
#if(MIN_FREQ <= 16000) && (MAX_FREQ_FS >= 16000)
#if(MIN_FREQ <= 16000) && (MAX_FREQ_FS >= 16000)
CHARIFY_SR(16000), /* sampleFreq - 32KHz */
#endif
#if(MIN_FREQ <= 32000) && (MAX_FREQ_FS >= 32000)
#if(MIN_FREQ <= 32000) && (MAX_FREQ_FS >= 32000)
CHARIFY_SR(32000), /* sampleFreq - 32KHz */
#endif
#if (MIN_FREQ <= 44100) && (MAX_FREQ_FS >= 44100)
#if (MIN_FREQ <= 44100) && (MAX_FREQ_FS >= 44100)
0x44, 0xAC, 0x00, /* sampleFreq - 44.1Khz */
#endif
#if (MIN_FREQ <= 48000) && (MAX_FREQ_FS >= 48000)
#if (MIN_FREQ <= 48000) && (MAX_FREQ_FS >= 48000)
0x80, 0xBB, 0x00, /* sampleFreq - 48KHz */
#endif
#if (MIN_FREQ <= 88200) && (MAX_FREQ_FS >= 88200)
#if (MIN_FREQ <= 88200) && (MAX_FREQ_FS >= 88200)
0x88, 0x58, 0x01, /* sampleFreq - 88.2KHz */
#endif
#if (MIN_FREQ <= 96000) && (MAX_FREQ_FS >= 96000)
#if (MIN_FREQ <= 96000) && (MAX_FREQ_FS >= 96000)
0x00, 0x77, 0x01, /* sampleFreq - 96KHz */
#endif
/* Standard Endpoint Descriptor */
0x09,
0x05, /* ENDPOINT */

View File

@@ -454,7 +454,7 @@ void usb_audio_io(chanend c_aud_in, chanend ?c_adc,
#if XUD_TILE != 0
, dfuInterface
#endif
#if (NUM_PDM_MICS > 0)
#if (NUM_PDM_MICS > 0)
, c_pdm_pcm
#endif
);
@@ -653,7 +653,7 @@ int main()
}
#endif
#if (NUM_PDM_MICS > 0)
#if (NUM_PDM_MICS > 0)
on stdcore[PDM_TILE]: pcm_pdm_mic(c_pdm_pcm);
#endif
USER_MAIN_CORES

View File

@@ -189,7 +189,7 @@ DOMIX_BOT(7)
.linkset setPtr.maxtimers, 0;
.linkset setPtr.maxthreads, 1;
setPtr:
ENTSP_lu6 0
ENTSP_lu6 0
shl r2, r2, 1
.xtabranch .label_0
bru r2

View File

@@ -29,7 +29,7 @@ void user_pdm_init();
int data_0[4*COEFS_PER_PHASE*MAX_DECIMATION_FACTOR] = {0};
int data_1[4*COEFS_PER_PHASE*MAX_DECIMATION_FACTOR] = {0};
frame_audio mic_audio[2];
frame_audio mic_audio[2];
void pdm_process(streaming chanend c_ds_output_0, streaming chanend c_ds_output_1, chanend c_audio)
{
@@ -38,13 +38,13 @@ void pdm_process(streaming chanend c_ds_output_0, streaming chanend c_ds_output_
int output[NUM_PDM_MICS];
user_pdm_init();
while(1)
{
{
unsigned samplerate;
c_audio :> samplerate;
unsigned decimationfactor = 48000/samplerate;
unsafe
@@ -60,16 +60,16 @@ void pdm_process(streaming chanend c_ds_output_0, streaming chanend c_ds_output_
while(1)
{
frame_audio * unsafe current = decimator_get_next_audio_frame(c_ds_output_0, c_ds_output_1, buffer, mic_audio);
unsafe
{
int req;
user_pdm_process(current, output);
c_audio :> req;
if(req)
{
{
for(int i = 0; i < NUM_PDM_MICS; i++)
{
c_audio <: output[i]*decimationfactor;
@@ -80,7 +80,7 @@ void pdm_process(streaming chanend c_ds_output_0, streaming chanend c_ds_output_
break;
}
}
}
}
}
}
@@ -92,14 +92,14 @@ void pcm_pdm_mic(chanend c_pcm_out)
{
streaming chan c_4x_pdm_mic_0, c_4x_pdm_mic_1;
streaming chan c_ds_output_0, c_ds_output_1;
/* TODO, always run mics at 3MHz */
/* TODO, always run mics at 3MHz */
configure_clock_src_divide(pdmclk, p_mclk, 2);
configure_port_clock_output(p_pdm_clk, pdmclk);
configure_in_port(p_pdm_mics, pdmclk);
start_clock(pdmclk);
par
par
{
pdm_rx(p_pdm_mics, c_4x_pdm_mic_0, c_4x_pdm_mic_1);
decimate_to_pcm_4ch(c_4x_pdm_mic_0, c_ds_output_0);

View File

@@ -56,7 +56,7 @@ unsigned int divide)
#endif
#if defined(__XS2A__)
/* Clock bitclock clock block from master clock pin (divided) */
/* Clock bitclock clock block from master clock pin (divided) */
configure_clock_src_divide(clk_audio_bclk, p_mclk_in, (divide/2));
configure_port_clock_output(p_bclk, clk_audio_bclk);
#else

View File

@@ -481,10 +481,10 @@ void buffer(register chanend c_aud_out, register chanend c_aud_in,
/* Number of MCLK ticks in this SOF period (E.g = 125 * 24.576 = 3072) */
int count = (int) ((short)(u_tmp - lastClock));
unsigned long long full_result = count * feedbackMul * sampleFreq;
clockcounter += full_result;
unsigned long long full_result = count * feedbackMul * sampleFreq;
clockcounter += full_result;
/* Store MCLK for next time around... */
lastClock = u_tmp;
@@ -494,20 +494,20 @@ void buffer(register chanend c_aud_out, register chanend c_aud_in,
if(sofCount == 128)
{
sofCount = 0;
clockcounter += mod_from_last_time;
clocks = clockcounter / masterClockFreq;
mod_from_last_time = clockcounter % masterClockFreq;
if(usb_speed == XUD_SPEED_HS)
{
{
clocks <<= 3;
}
else
{
clocks <<= 6;
}
#ifdef FB_TOLERANCE_TEST
if (clocks > (expected_fb - FB_TOLERANCE) &&
clocks < (expected_fb + FB_TOLERANCE))