forked from PAWPAW-Mirror/lib_xua
EnableBufferedPort() now run on p_dsd_clk on every audio port config. This is because deliver sets p_dsd_clk low to ensure that stop_clock() completes. This avoids a run time exception when p_dsd_clk is not yet turned on.
This commit is contained in:
@@ -619,12 +619,17 @@ enum USBEndpointNumber_Out
|
||||
|
||||
#define MAX_VOL (0x20000000)
|
||||
|
||||
|
||||
#ifdef SELF_POWERED
|
||||
#define BMAX_POWER 0
|
||||
/* Default to taking no power from the bus in self-powered mode */
|
||||
#ifndef BMAX_POWER
|
||||
#define BMAX_POWER 0
|
||||
#endif
|
||||
#else
|
||||
#ifndef BMAX_POWER
|
||||
#define BMAX_POWER 250
|
||||
#endif
|
||||
/* Default to taking 500mA from the bus in bus-powered mode */
|
||||
#ifndef BMAX_POWER
|
||||
#define BMAX_POWER 250
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -53,7 +53,13 @@ void ConfigAudioPortsWrapper(
|
||||
#endif
|
||||
unsigned int divide, unsigned int dsdMode)
|
||||
{
|
||||
|
||||
/* Ensure dsd clock is on in all modes since I2S mode sets it low on exit
|
||||
* to avoid stop_clock() potentially pausing forever. If this is not done
|
||||
* an exception will be raised with audio() attempts to set this port low
|
||||
*/
|
||||
/* TODO Do we really need to do this on every SF change? Once is probably enough */
|
||||
EnableBufferedPort(p_dsd_clk, 32);
|
||||
|
||||
if(dsdMode)
|
||||
{
|
||||
/* Make sure the ports are on and buffered - just in case they are not shared with I2S */
|
||||
@@ -61,7 +67,6 @@ unsigned int divide, unsigned int dsdMode)
|
||||
{
|
||||
EnableBufferedPort(p_dsd_dac[i], 32);
|
||||
}
|
||||
EnableBufferedPort(p_dsd_clk, 32);
|
||||
|
||||
ConfigAudioPorts(
|
||||
#if (DSD_CHANS_DAC != 0)
|
||||
|
||||
Reference in New Issue
Block a user