c_dig_rx is no longer nullable (helps with timing due to issue with compiler checks)

This commit is contained in:
Ross Owen
2014-09-18 11:50:08 +01:00
parent 8465ae1c5e
commit cc4165e57b
3 changed files with 26 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
#ifndef __audio_h__
#define __audio_h__
#include "devicedefines.h"
/** The audio driver thread.
*
* This function drives I2S ports and handles samples to/from other digital
@@ -13,6 +14,10 @@
* \param c_config An optional channel that will be passed on to the
* CODEC configuration functions.
*/
void audio(chanend c_in, chanend ?c_dig, chanend ?c_config, chanend ?c_adc);
void audio(chanend c_in,
#if (defined(SPDIF_RX) || defined(ADAT_RX))
chanend c_dig,
#endif
chanend ?c_config, chanend ?c_adc);
#endif // __audio_h__

View File

@@ -144,7 +144,11 @@ static inline void doI2SClocks(unsigned divide)
/* I2S delivery thread */
#pragma unsafe arrays
unsigned static deliver(chanend c_out, chanend ?c_spd_out, unsigned divide, unsigned curSamFreq, chanend ?c_dig_rx, chanend ?c_adc)
unsigned static deliver(chanend c_out, chanend ?c_spd_out, unsigned divide, unsigned curSamFreq,
#if(defined(SPDIF_RX) || defined(ADAT_RX))
chanend c_dig_rx,
#endif
chanend ?c_adc)
{
#if (I2S_CHANS_ADC != 0) || defined(SPDIF)
unsigned sample;
@@ -779,7 +783,11 @@ unsigned static dummy_deliver(chanend c_out)
#define SAMPLES_PER_PRINT 1
void audio(chanend c_mix_out, chanend ?c_dig_rx, chanend ?c_config, chanend ?c)
void audio(chanend c_mix_out,
#if (defined(ADAT_RX) || defined(SPDIF_RX))
chanend c_dig_rx,
#endif
chanend ?c_config, chanend ?c)
{
#ifdef SPDIF
chan c_spdif_out;

View File

@@ -429,9 +429,17 @@ chanend ?c_clk_int
{
thread_speed();
#ifdef MIXER
audio(c_mix_out, c_dig_rx, c_aud_cfg, c_adc);
audio(c_mix_out,
#if defined(SPDIF_RX) || defined(ADAT_RX)
c_dig_rx,
#endif
c_aud_cfg, c_adc);
#else
audio(c_aud_in, c_dig_rx, c_aud_cfg, c_adc);
audio(c_aud_in,
#if defined(SPDIF_RX) || defined(ADAT_RX)
c_dig_rx,
#endif
c_aud_cfg, c_adc);
#endif
}