Remove some use of global resources

This commit is contained in:
xross
2022-07-28 14:15:16 +01:00
parent a0f5591e0b
commit 9fdacb2903
4 changed files with 17 additions and 18 deletions

View File

@@ -789,12 +789,11 @@ void XUA_AudioHub(chanend ?c_aud, clock ?clk_audio_mclk, clock ?clk_audio_bclk,
null,
p_dsd_clk,
#endif
divide, curSamFreq, dsdMode);
p_mclk_in, clk_audio_bclk, divide, curSamFreq, dsdMode);
}
else
#endif
{
ConfigAudioPortsWrapper(
#if (I2S_CHANS_DAC != 0)
p_i2s_dac,
@@ -813,7 +812,7 @@ void XUA_AudioHub(chanend ?c_aud, clock ?clk_audio_mclk, clock ?clk_audio_bclk,
p_bclk,
#endif
#endif
divide, curSamFreq, dsdMode);
p_mclk_in, clk_audio_bclk, divide, curSamFreq, dsdMode);
}

View File

@@ -1,4 +1,4 @@
// Copyright 2013-2021 XMOS LIMITED.
// Copyright 2013-2022 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#include <xs1.h>
@@ -6,7 +6,6 @@
#include <platform.h>
#undef __ASSEMBLER__
#include "audioports.h"
#include <xccompat.h>
#include "xua.h"
/* Note since DSD ports could be reused for I2S ports we do all the setup manually in C */
@@ -46,7 +45,7 @@ void ConfigAudioPortsWrapper(
port p_lrclk,
port p_bclk,
#endif
unsigned int divide, unsigned curSamFreq, unsigned int dsdMode)
port p_mclk_in, clock clk_audio_bclk, unsigned int divide, unsigned curSamFreq, unsigned int dsdMode)
{
ConfigAudioPorts(
#if (I2S_CHANS_DAC != 0) || (DSD_CHANS_DAC != 0)
@@ -61,6 +60,6 @@ unsigned int divide, unsigned curSamFreq, unsigned int dsdMode)
p_lrclk,
p_bclk,
#endif
divide, curSamFreq);
p_mclk_in, clk_audio_bclk, divide, curSamFreq);
}

View File

@@ -1,9 +1,12 @@
// Copyright 2011-2021 XMOS LIMITED.
// Copyright 2011-2022 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#ifndef _AUDIOPORTS_H_
#define _AUDIOPORTS_H_
#include <xccompat.h>
#ifdef __STDC__
typedef unsigned clock;
#endif
#include "xua.h"
#ifdef __XC__
@@ -28,7 +31,7 @@ void ConfigAudioPorts(
in port p_bclk,
#endif
#endif
unsigned int divide, unsigned int curSamFreq);
in port p_mclk_in, clock clk_audio_bclk, unsigned int divide, unsigned int curSamFreq);
#else
void ConfigAudioPorts(
@@ -51,7 +54,7 @@ void ConfigAudioPorts(
port p_bclk,
#endif
#endif
unsigned int divide, unsigned int curSamFreq);
port p_mclk_in, clock clk_audio_bclk, unsigned int divide, unsigned int curSamFreq);
#endif /* __XC__*/
@@ -76,7 +79,7 @@ void ConfigAudioPortsWrapper(
buffered in port:32 p_bclk,
#endif
#endif
unsigned int divide, unsigned curSamFreq, unsigned int dsdMode);
in port p_mclk_in, clock clk_audio_bclk, unsigned int divide, unsigned curSamFreq, unsigned int dsdMode);
#else
void ConfigAudioPortsWrapper(
@@ -92,7 +95,7 @@ void ConfigAudioPortsWrapper(
port p_lrclk,
port p_bclk,
#endif
unsigned int divide, unsigned curSamFreq, unsigned int dsdMode);
port p_mclk_in, clock clk_audio_bclk, unsigned int divide, unsigned curSamFreq, unsigned int dsdMode);
#endif /* __XC__*/

View File

@@ -1,4 +1,4 @@
// Copyright 2011-2021 XMOS LIMITED.
// Copyright 2011-2022 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#include <xs1.h>
#include <platform.h>
@@ -6,11 +6,9 @@
#include "xua.h"
#include "audioports.h"
extern in port p_mclk_in;
//extern in port p_mclk_in;
extern clock clk_audio_mclk;
extern clock clk_audio_bclk;
//extern clock clk_audio_bclk;
void ConfigAudioPorts(
#if (I2S_CHANS_DAC != 0) || (DSD_CHANS_DAC != 0)
@@ -32,7 +30,7 @@ void ConfigAudioPorts(
in port p_bclk,
#endif
#endif
unsigned int divide, unsigned curSamFreq)
in port p_mclk_in, clock clk_audio_bclk, unsigned int divide, unsigned curSamFreq)
{
#if (I2S_CHANS_DAC != 0) || (I2S_CHANS_ADC != 0)