forked from PAWPAW-Mirror/lib_xua
Merge branch 'master' into develop
This commit is contained in:
@@ -1,8 +1,10 @@
|
|||||||
lib_xua
|
lib_xua
|
||||||
#######
|
#######
|
||||||
|
|
||||||
:Version: 3.5.0
|
:Version: 3.5.1
|
||||||
:Vendor: XMOS
|
:Vendor: XMOS
|
||||||
|
|
||||||
|
|
||||||
:Scope: General Use
|
:Scope: General Use
|
||||||
|
|
||||||
Summary
|
Summary
|
||||||
|
|||||||
@@ -38,12 +38,12 @@ void InitPorts_master(buffered _XUA_CLK_DIR port:32 p_lrclk, buffered _XUA_CLK_D
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
unsigned tmp;
|
unsigned tmp;
|
||||||
|
|
||||||
if(XUA_I2S_N_BITS == 32)
|
if(XUA_I2S_N_BITS == 32)
|
||||||
p_lrclk <: 0 @ tmp;
|
p_lrclk <: 0 @ tmp;
|
||||||
else
|
else
|
||||||
tmp = partout_timestamped(p_lrclk, XUA_I2S_N_BITS, 0);
|
tmp = partout_timestamped(p_lrclk, XUA_I2S_N_BITS, 0);
|
||||||
|
|
||||||
tmp += 100;
|
tmp += 100;
|
||||||
|
|
||||||
/* Since BCLK is free-running, setup outputs/inputs at a known point in the future */
|
/* Since BCLK is free-running, setup outputs/inputs at a known point in the future */
|
||||||
@@ -72,7 +72,7 @@ void InitPorts_master(buffered _XUA_CLK_DIR port:32 p_lrclk, buffered _XUA_CLK_D
|
|||||||
for(int i = 0; i < I2S_WIRES_ADC; i++)
|
for(int i = 0; i < I2S_WIRES_ADC; i++)
|
||||||
{
|
{
|
||||||
asm("setpt res[%0], %1"::"r"(p_i2s_adc[i]),"r"(tmp-1));
|
asm("setpt res[%0], %1"::"r"(p_i2s_adc[i]),"r"(tmp-1));
|
||||||
|
|
||||||
if(XUA_I2S_N_BITS != 32)
|
if(XUA_I2S_N_BITS != 32)
|
||||||
set_port_shift_count(p_i2s_adc[i], XUA_I2S_N_BITS);
|
set_port_shift_count(p_i2s_adc[i], XUA_I2S_N_BITS);
|
||||||
}
|
}
|
||||||
@@ -127,13 +127,13 @@ void InitPorts_slave(buffered _XUA_CLK_DIR port:32 p_lrclk, buffered _XUA_CLK_DI
|
|||||||
for(int i = 0; i < I2S_WIRES_ADC; i++)
|
for(int i = 0; i < I2S_WIRES_ADC; i++)
|
||||||
{
|
{
|
||||||
asm("setpt res[%0], %1"::"r"(p_i2s_adc[i]),"r"(tmp-1));
|
asm("setpt res[%0], %1"::"r"(p_i2s_adc[i]),"r"(tmp-1));
|
||||||
if(XUA_I2S_N_BITS != 32)
|
if(XUA_I2S_N_BITS != 32)
|
||||||
set_port_shift_count(p_i2s_adc[i], XUA_I2S_N_BITS);
|
set_port_shift_count(p_i2s_adc[i], XUA_I2S_N_BITS);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
asm("setpt res[%0], %1"::"r"(p_lrclk),"r"(tmp-1));
|
asm("setpt res[%0], %1"::"r"(p_lrclk),"r"(tmp-1));
|
||||||
if(XUA_I2S_N_BITS != 32)
|
if(XUA_I2S_N_BITS != 32)
|
||||||
set_port_shift_count(p_lrclk, XUA_I2S_N_BITS);
|
set_port_shift_count(p_lrclk, XUA_I2S_N_BITS);
|
||||||
#endif /* (I2S_CHANS_ADC != 0 || I2S_CHANS_DAC != 0) */
|
#endif /* (I2S_CHANS_ADC != 0 || I2S_CHANS_DAC != 0) */
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ static inline int HandleSampleClock(int frameCount, buffered _XUA_CLK_DIR port:3
|
|||||||
unsigned syncError = 0;
|
unsigned syncError = 0;
|
||||||
unsigned lrval = 0;
|
unsigned lrval = 0;
|
||||||
const unsigned lrval_mask = (0xffffffff << (32 - XUA_I2S_N_BITS));
|
const unsigned lrval_mask = (0xffffffff << (32 - XUA_I2S_N_BITS));
|
||||||
|
|
||||||
if(XUA_I2S_N_BITS != 32)
|
if(XUA_I2S_N_BITS != 32)
|
||||||
{
|
{
|
||||||
asm volatile("in %0, res[%1]":"=r"(lrval):"r"(p_lrclk):"memory");
|
asm volatile("in %0, res[%1]":"=r"(lrval):"r"(p_lrclk):"memory");
|
||||||
@@ -306,7 +306,7 @@ unsigned static AudioHub_MainLoop(chanend ?c_out, chanend ?c_spd_out
|
|||||||
// Manual IN instruction since compiler generates an extra setc per IN (bug #15256)
|
// Manual IN instruction since compiler generates an extra setc per IN (bug #15256)
|
||||||
unsigned sample;
|
unsigned sample;
|
||||||
asm volatile("in %0, res[%1]" : "=r"(sample) : "r"(p_i2s_adc[index]));
|
asm volatile("in %0, res[%1]" : "=r"(sample) : "r"(p_i2s_adc[index]));
|
||||||
|
|
||||||
sample = bitrev(sample);
|
sample = bitrev(sample);
|
||||||
if(XUA_I2S_N_BITS != 32)
|
if(XUA_I2S_N_BITS != 32)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ static void updateMasterVol(int unitID, chanend ?c_mix_ctl)
|
|||||||
outuint(c_mix_ctl, x);
|
outuint(c_mix_ctl, x);
|
||||||
outct(c_mix_ctl, XS1_CT_END);
|
outct(c_mix_ctl, XS1_CT_END);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
unsafe
|
unsafe
|
||||||
{
|
{
|
||||||
unsigned int * unsafe multOutPtr = multOut;
|
unsigned int * unsafe multOutPtr = multOut;
|
||||||
|
|||||||
Reference in New Issue
Block a user