Merge pull request #351 from xross/develop

Fixes for XUA_USB_EN=0
This commit is contained in:
Ross Owen
2023-11-03 10:11:31 +00:00
committed by GitHub
2 changed files with 65 additions and 65 deletions

View File

@@ -85,10 +85,10 @@
#if defined(NATIVE_DSD) && (NATIVE_DSD == 0) #if defined(NATIVE_DSD) && (NATIVE_DSD == 0)
#undef NATIVE_DSD #undef NATIVE_DSD
#else #else
#define NATIVE_DSD 1 /* Always enable Native DSD when DSD mode is enabled */ #define NATIVE_DSD (1) /* Always enable Native DSD when DSD mode is enabled */
#endif #endif
#else #else
#define DSD_CHANS_DAC 0 #define DSD_CHANS_DAC (0)
#endif #endif
#define XUA_PCM_FORMAT_I2S (0) #define XUA_PCM_FORMAT_I2S (0)
@@ -114,9 +114,9 @@
**/ **/
#ifndef I2S_CHANS_PER_FRAME #ifndef I2S_CHANS_PER_FRAME
#if (XUA_PCM_FORMAT == XUA_PCM_FORMAT_TDM) #if (XUA_PCM_FORMAT == XUA_PCM_FORMAT_TDM)
#define I2S_CHANS_PER_FRAME 8 #define I2S_CHANS_PER_FRAME (8)
#else #else
#define I2S_CHANS_PER_FRAME 2 #define I2S_CHANS_PER_FRAME (2)
#endif #endif
#endif #endif
@@ -257,14 +257,16 @@
* Default: 2 (Audio Class version 2.0) * Default: 2 (Audio Class version 2.0)
*/ */
#ifndef AUDIO_CLASS #ifndef AUDIO_CLASS
#define AUDIO_CLASS 2 #define AUDIO_CLASS (2)
#endif #endif
/** /**
* @brief Whether or not to fall back to Audio Class 1.0 in USB Full-speed. Default: 0 (Disabled) * @brief Whether or not to fall back to Audio Class 1.0 in USB Full-speed.
*
* Default: 0 (Disabled i.e. do not fall back to UAC 1.0
*/ */
#ifndef AUDIO_CLASS_FALLBACK #ifndef AUDIO_CLASS_FALLBACK
#define AUDIO_CLASS_FALLBACK 0 /* Default to not falling back to UAC 1 */ #define AUDIO_CLASS_FALLBACK (0)
#endif #endif
/** /**
@@ -276,7 +278,7 @@
#if (AUDIO_CLASS == 2) #if (AUDIO_CLASS == 2)
/* Whether to run in Audio Class 2.0 mode in USB Full-speed */ /* Whether to run in Audio Class 2.0 mode in USB Full-speed */
#if !defined(FULL_SPEED_AUDIO_2) && (AUDIO_CLASS_FALLBACK == 0) #if !defined(FULL_SPEED_AUDIO_2) && (AUDIO_CLASS_FALLBACK == 0)
#define FULL_SPEED_AUDIO_2 1 /* Default to falling back to UAC2 */ #define FULL_SPEED_AUDIO_2 (1) /* Default to falling back to UAC2 */
#endif #endif
#endif #endif

View File

@@ -336,7 +336,7 @@ void usb_audio_io(chanend ?c_aud_in,
par par
{ {
#if (MIXER) #if (MIXER && XUA_USB_EN)
/* Mixer cores(s) */ /* Mixer cores(s) */
{ {
thread_speed(); thread_speed();
@@ -493,14 +493,12 @@ int main()
on tile[XUD_TILE]: on tile[XUD_TILE]:
par par
{ {
#if (XUD_TILE == 0) #if XUA_USB_EN
#if ((XUD_TILE == 0) && (XUA_DFU_EN == 1))
/* Check if USB is on the flash tile (tile 0) */ /* Check if USB is on the flash tile (tile 0) */
#if (XUA_DFU_EN == 1)
[[distribute]] [[distribute]]
DFUHandler(dfuInterface, null); DFUHandler(dfuInterface, null);
#endif #endif
#endif
#if XUA_USB_EN
/* Core USB task, buffering, USB etc */ /* Core USB task, buffering, USB etc */
{ {