forked from PAWPAW-Mirror/lib_xua
A more elegant solution to the DSD stop_clock() pausing issue. Just set ALL clocks to 0 before deliver returns
This commit is contained in:
@@ -325,7 +325,6 @@ extern void device_reboot(void);
|
||||
p_bclk <: 0;
|
||||
#if(DSD_CHANS_DAC != 0)
|
||||
/* DSD Clock might not be shared with lrclk or bclk... */
|
||||
if(dsdMode)
|
||||
p_dsd_clk <: 0;
|
||||
#endif
|
||||
command = inct(c_out);
|
||||
@@ -714,6 +713,7 @@ extern void device_reboot(void);
|
||||
// Set clocks low
|
||||
p_lrclk <: 0;
|
||||
p_bclk <: 0;
|
||||
p_dsd_clk <: 0;
|
||||
return {0,0};
|
||||
}
|
||||
}
|
||||
@@ -731,6 +731,9 @@ extern void device_reboot(void);
|
||||
if((DSD_MASK(samplesOut[0]) != DSD_MARKER_2) && (DSD_MASK(samplesOut[1]) != DSD_MARKER_2))
|
||||
{
|
||||
dsdMode = 0;
|
||||
// Set clocks low
|
||||
p_lrclk <: 0;
|
||||
p_bclk <: 0;
|
||||
p_dsd_clk <: 0;
|
||||
return {0,0};
|
||||
}
|
||||
|
||||
@@ -32,16 +32,7 @@ unsigned int divide)
|
||||
{
|
||||
|
||||
#ifndef CODEC_MASTER
|
||||
/* Output 0 on BCLK to ensure clock is low
|
||||
* Required as stop_clock will only complete when the clock is low
|
||||
*/
|
||||
// configure_out_port_no_ready(p_bclk, clk_audio_mclk, 0);
|
||||
// p_bclk <: 0;
|
||||
|
||||
/* Stop_clock() will not complete if the source to the clock-block is not low
|
||||
* since we are switching between DSD and I2S we grab the source from the clock
|
||||
* -block and set it low
|
||||
*/
|
||||
#if 0
|
||||
{
|
||||
unsigned clockResId;
|
||||
unsigned portResId;
|
||||
@@ -50,6 +41,11 @@ unsigned int divide)
|
||||
if(portResId !=1)
|
||||
asm("out res[%0], %1":: "r"(portResId), "r"(0));
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Note this call to stop_clock() will pause forever if the port clocking the clock-block is not low.
|
||||
* deliver() should return with this being the case - however, if you are having trouble the code
|
||||
* above can be enabled */
|
||||
stop_clock(clk_audio_bclk);
|
||||
|
||||
if(!isnull(p_lrclk))
|
||||
|
||||
Reference in New Issue
Block a user