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, null,
p_dsd_clk, p_dsd_clk,
#endif #endif
divide, curSamFreq, dsdMode); p_mclk_in, clk_audio_bclk, divide, curSamFreq, dsdMode);
} }
else else
#endif #endif
{ {
ConfigAudioPortsWrapper( ConfigAudioPortsWrapper(
#if (I2S_CHANS_DAC != 0) #if (I2S_CHANS_DAC != 0)
p_i2s_dac, p_i2s_dac,
@@ -813,7 +812,7 @@ void XUA_AudioHub(chanend ?c_aud, clock ?clk_audio_mclk, clock ?clk_audio_bclk,
p_bclk, p_bclk,
#endif #endif
#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. // This Software is subject to the terms of the XMOS Public Licence: Version 1.
#include <xs1.h> #include <xs1.h>
@@ -6,7 +6,6 @@
#include <platform.h> #include <platform.h>
#undef __ASSEMBLER__ #undef __ASSEMBLER__
#include "audioports.h" #include "audioports.h"
#include <xccompat.h>
#include "xua.h" #include "xua.h"
/* Note since DSD ports could be reused for I2S ports we do all the setup manually in C */ /* 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_lrclk,
port p_bclk, port p_bclk,
#endif #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( ConfigAudioPorts(
#if (I2S_CHANS_DAC != 0) || (DSD_CHANS_DAC != 0) #if (I2S_CHANS_DAC != 0) || (DSD_CHANS_DAC != 0)
@@ -61,6 +60,6 @@ unsigned int divide, unsigned curSamFreq, unsigned int dsdMode)
p_lrclk, p_lrclk,
p_bclk, p_bclk,
#endif #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. // This Software is subject to the terms of the XMOS Public Licence: Version 1.
#ifndef _AUDIOPORTS_H_ #ifndef _AUDIOPORTS_H_
#define _AUDIOPORTS_H_ #define _AUDIOPORTS_H_
#include <xccompat.h> #include <xccompat.h>
#ifdef __STDC__
typedef unsigned clock;
#endif
#include "xua.h" #include "xua.h"
#ifdef __XC__ #ifdef __XC__
@@ -28,7 +31,7 @@ void ConfigAudioPorts(
in port p_bclk, in port p_bclk,
#endif #endif
#endif #endif
unsigned int divide, unsigned int curSamFreq); in port p_mclk_in, clock clk_audio_bclk, unsigned int divide, unsigned int curSamFreq);
#else #else
void ConfigAudioPorts( void ConfigAudioPorts(
@@ -51,7 +54,7 @@ void ConfigAudioPorts(
port p_bclk, port p_bclk,
#endif #endif
#endif #endif
unsigned int divide, unsigned int curSamFreq); port p_mclk_in, clock clk_audio_bclk, unsigned int divide, unsigned int curSamFreq);
#endif /* __XC__*/ #endif /* __XC__*/
@@ -76,7 +79,7 @@ void ConfigAudioPortsWrapper(
buffered in port:32 p_bclk, buffered in port:32 p_bclk,
#endif #endif
#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 #else
void ConfigAudioPortsWrapper( void ConfigAudioPortsWrapper(
@@ -92,7 +95,7 @@ void ConfigAudioPortsWrapper(
port p_lrclk, port p_lrclk,
port p_bclk, port p_bclk,
#endif #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__*/ #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. // This Software is subject to the terms of the XMOS Public Licence: Version 1.
#include <xs1.h> #include <xs1.h>
#include <platform.h> #include <platform.h>
@@ -6,11 +6,9 @@
#include "xua.h" #include "xua.h"
#include "audioports.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_mclk;
extern clock clk_audio_bclk; //extern clock clk_audio_bclk;
void ConfigAudioPorts( void ConfigAudioPorts(
#if (I2S_CHANS_DAC != 0) || (DSD_CHANS_DAC != 0) #if (I2S_CHANS_DAC != 0) || (DSD_CHANS_DAC != 0)
@@ -32,7 +30,7 @@ void ConfigAudioPorts(
in port p_bclk, in port p_bclk,
#endif #endif
#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) #if (I2S_CHANS_DAC != 0) || (I2S_CHANS_ADC != 0)