forked from PAWPAW-Mirror/lib_xua
xpd: Cleaned up whitespace
This commit is contained in:
@@ -279,7 +279,7 @@ static inline unsigned DoSampleTransfer(chanend c_out, const int readBuffNo, con
|
|||||||
#else
|
#else
|
||||||
inuint(c_out);
|
inuint(c_out);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
UserBufferManagement(samplesOut, samplesIn[readBuffNo]
|
UserBufferManagement(samplesOut, samplesIn[readBuffNo]
|
||||||
#ifdef RUN_DSP_TASK
|
#ifdef RUN_DSP_TASK
|
||||||
, i_dsp
|
, i_dsp
|
||||||
@@ -294,7 +294,7 @@ static inline unsigned DoSampleTransfer(chanend c_out, const int readBuffNo, con
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -487,8 +487,8 @@ unsigned static deliver(chanend c_out, chanend ?c_spd_out,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
unsigned command = DoSampleTransfer(c_out, readBuffNo, underflowWord
|
unsigned command = DoSampleTransfer(c_out, readBuffNo, underflowWord
|
||||||
#ifdef RUN_DSP_TASK
|
#ifdef RUN_DSP_TASK
|
||||||
, i_dsp
|
, i_dsp
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
@@ -822,10 +822,10 @@ unsigned static deliver(chanend c_out, chanend ?c_spd_out,
|
|||||||
/* 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
|
||||||
#ifdef RUN_DSP_TASK
|
#ifdef RUN_DSP_TASK
|
||||||
, i_dsp
|
, i_dsp
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
else
|
else
|
||||||
command = DoSampleTransfer(c_out, 0, underflowWord
|
command = DoSampleTransfer(c_out, 0, underflowWord
|
||||||
@@ -1190,7 +1190,7 @@ chanend ?c_config, chanend ?c
|
|||||||
#if (NUM_PDM_MICS > 0)
|
#if (NUM_PDM_MICS > 0)
|
||||||
c_pdm_in,
|
c_pdm_in,
|
||||||
#endif
|
#endif
|
||||||
null
|
null
|
||||||
#ifdef RUN_DSP_TASK
|
#ifdef RUN_DSP_TASK
|
||||||
, i_dsp
|
, i_dsp
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#include "devicedefines.h"
|
#include "devicedefines.h"
|
||||||
|
|
||||||
/* Default implentation for UserBufferManagement() */
|
/* Default implentation for UserBufferManagement() */
|
||||||
void UserBufferManagement(unsigned sampsFromUsbToAudio[], unsigned sampsFromAudioToUsb[]
|
void UserBufferManagement(unsigned sampsFromUsbToAudio[], unsigned sampsFromAudioToUsb[]
|
||||||
#ifdef RUN_DSP_TASK
|
#ifdef RUN_DSP_TASK
|
||||||
, unsigned i_dsp
|
, unsigned i_dsp
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -678,7 +678,7 @@ int main()
|
|||||||
on stdcore[PDM_TILE]: pdm_mic(c_ds_output);
|
on stdcore[PDM_TILE]: pdm_mic(c_ds_output);
|
||||||
on stdcore[PDM_TILE].core[0]: pdm_buffer(c_ds_output, c_pdm_pcm, i_mic_process);
|
on stdcore[PDM_TILE].core[0]: pdm_buffer(c_ds_output, c_pdm_pcm, i_mic_process);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
USER_MAIN_CORES
|
USER_MAIN_CORES
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ void pdm_buffer(streaming chanend c_ds_output[2], chanend c_audio
|
|||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
unsigned buffer;
|
unsigned buffer;
|
||||||
int output[NUM_PDM_MICS];
|
int output[NUM_PDM_MICS];
|
||||||
unsigned samplerate;
|
unsigned samplerate;
|
||||||
|
|
||||||
@@ -45,13 +45,13 @@ void pdm_buffer(streaming chanend c_ds_output[2], chanend c_audio
|
|||||||
#else
|
#else
|
||||||
user_pdm_init();
|
user_pdm_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mic_array_decimator_conf_common_t dcc;
|
mic_array_decimator_conf_common_t dcc;
|
||||||
const int * unsafe fir_coefs[7];
|
const int * unsafe fir_coefs[7];
|
||||||
mic_array_frame_time_domain * unsafe current;
|
mic_array_frame_time_domain * unsafe current;
|
||||||
mic_array_decimator_config_t dc[2];
|
mic_array_decimator_config_t dc[2];
|
||||||
|
|
||||||
/* Get initial sample-rate and compute decimation factor */
|
/* Get initial sample-rate and compute decimation factor */
|
||||||
c_audio :> samplerate;
|
c_audio :> samplerate;
|
||||||
unsigned decimationfactor = 96000/samplerate;
|
unsigned decimationfactor = 96000/samplerate;
|
||||||
|
|
||||||
@@ -114,7 +114,7 @@ void pdm_buffer(streaming chanend c_ds_output[2], chanend c_audio
|
|||||||
select
|
select
|
||||||
{
|
{
|
||||||
case c_audio :> req:
|
case c_audio :> req:
|
||||||
|
|
||||||
/* Audio IO core requests samples */
|
/* Audio IO core requests samples */
|
||||||
if(req)
|
if(req)
|
||||||
unsafe{
|
unsafe{
|
||||||
@@ -123,7 +123,7 @@ void pdm_buffer(streaming chanend c_ds_output[2], chanend c_audio
|
|||||||
c_audio <: output[i];
|
c_audio <: output[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get a new frame of mic data */
|
/* Get a new frame of mic data */
|
||||||
mic_array_frame_time_domain * unsafe current = mic_array_get_next_time_domain_frame(c_ds_output, 2, buffer, mic_audio, dc);
|
mic_array_frame_time_domain * unsafe current = mic_array_get_next_time_domain_frame(c_ds_output, 2, buffer, mic_audio, dc);
|
||||||
|
|
||||||
/* Run user code */
|
/* Run user code */
|
||||||
@@ -137,12 +137,12 @@ void pdm_buffer(streaming chanend c_ds_output[2], chanend c_audio
|
|||||||
unsafe{
|
unsafe{
|
||||||
/* Sample rate change */
|
/* Sample rate change */
|
||||||
c_audio :> samplerate;
|
c_audio :> samplerate;
|
||||||
|
|
||||||
/* Re-config the mic decimators for the new sample-rate */
|
/* Re-config the mic decimators for the new sample-rate */
|
||||||
decimationfactor = 96000/samplerate;
|
decimationfactor = 96000/samplerate;
|
||||||
dcc.output_decimation_factor = decimationfactor;
|
dcc.output_decimation_factor = decimationfactor;
|
||||||
dcc.coefs=fir_coefs[decimationfactor/2];
|
dcc.coefs=fir_coefs[decimationfactor/2];
|
||||||
|
|
||||||
mic_array_decimator_configure(c_ds_output, 2, dc);
|
mic_array_decimator_configure(c_ds_output, 2, dc);
|
||||||
mic_array_init_time_domain_frame(c_ds_output, 2, buffer, mic_audio, dc);
|
mic_array_init_time_domain_frame(c_ds_output, 2, buffer, mic_audio, dc);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user