diff --git a/module_usb_audio/devicedefines.h b/module_usb_audio/devicedefines.h index 13727c32..f9805b63 100644 --- a/module_usb_audio/devicedefines.h +++ b/module_usb_audio/devicedefines.h @@ -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 diff --git a/module_usb_audio/ports/audioports.c b/module_usb_audio/ports/audioports.c index 116b7f40..a813f5aa 100644 --- a/module_usb_audio/ports/audioports.c +++ b/module_usb_audio/ports/audioports.c @@ -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)