RUN_DSP_TASK tidy in audio_io

This commit is contained in:
Ross Owen
2016-05-20 15:29:35 +01:00
parent 2e97824604
commit 547d9a77d3

View File

@@ -230,18 +230,10 @@ static inline void TransferAdatTxSamples(chanend c_adat_out, const unsigned samp
/* sampsFromUsbToAudio: The sample frame the device has recived from the host and is going to play to the output audio interfaces */ /* sampsFromUsbToAudio: The sample frame the device has recived from the host and is going to play to the output audio interfaces */
/* sampsFromAudioToUsb: The sample frame that was received from the audio interfaces and that the device is going to send to the host */ /* sampsFromAudioToUsb: The sample frame that was received from the audio interfaces and that the device is going to send to the host */
void UserBufferManagement(unsigned sampsFromUsbToAudio[], unsigned sampsFromAudioToUsb[] void UserBufferManagement(unsigned sampsFromUsbToAudio[], unsigned sampsFromAudioToUsb[], client audManage_if i_audMan);
//#ifdef RUN_DSP_TASK
, client audManage_if i_audMan
//#endif
);
#pragma unsafe arrays #pragma unsafe arrays
static inline unsigned DoSampleTransfer(chanend c_out, const int readBuffNo, const unsigned underflowWord static inline unsigned DoSampleTransfer(chanend c_out, const int readBuffNo, const unsigned underflowWord, client audManage_if i_audMan)
//#ifdef RUN_DSP_TASK
, client audManage_if i_audMan
//#endif
)
{ {
outuint(c_out, underflowWord); outuint(c_out, underflowWord);
@@ -294,7 +286,6 @@ static inline unsigned DoSampleTransfer(chanend c_out, const int readBuffNo, con
#endif #endif
} }
return 0; return 0;
} }
@@ -432,7 +423,7 @@ 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,
@@ -445,11 +436,8 @@ unsigned static deliver(chanend c_out, chanend ?c_spd_out,
#if (NUM_PDM_MICS > 0) #if (NUM_PDM_MICS > 0)
chanend c_pdm_pcm, chanend c_pdm_pcm,
#endif #endif
chanend ?unused chanend ?unused,
//#ifdef RUN_DSP_TASK client audManage_if i_audMan)
, client audManage_if i_audMan
//#endif
)
{ {
/* Since DAC and ADC buffered ports off by one sample we buffer previous ADC frame */ /* Since DAC and ADC buffered ports off by one sample we buffer previous ADC frame */
@@ -486,11 +474,7 @@ 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, i_audMan);
//#ifdef RUN_DSP_TASK
, i_audMan
//#endif
);
#ifdef ADAT_TX #ifdef ADAT_TX
unsafe{ unsafe{
@@ -650,7 +634,6 @@ unsigned static deliver(chanend c_out, chanend ?c_spd_out,
p_lrclk <: 0x00000000; p_lrclk <: 0x00000000;
#else #else
p_lrclk <: 0x80000000; p_lrclk <: 0x80000000;
#endif #endif
#endif #endif
@@ -824,18 +807,9 @@ 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, i_audMan);
//#ifdef RUN_DSP_TASK
, i_audMan
//#endif
);
else else
command = DoSampleTransfer(c_out, 0, underflowWord command = DoSampleTransfer(c_out, 0, underflowWord, i_audMan);
//#ifdef RUN_DSP_TASK
, i_audMan
//#endif
);
if(command) if(command)
{ {
@@ -947,9 +921,7 @@ chanend ?c_config, chanend ?c
#if (NUM_PDM_MICS > 0) #if (NUM_PDM_MICS > 0)
, chanend c_pdm_in , chanend c_pdm_in
#endif #endif
//#ifdef RUN_DSP_TASK
, client audManage_if i_audMan , client audManage_if i_audMan
//#endif
) )
{ {
#if defined (SPDIF_TX) && (SPDIF_TX_TILE == AUDIO_IO_TILE) #if defined (SPDIF_TX) && (SPDIF_TX_TILE == AUDIO_IO_TILE)