diff --git a/module_usb_audio/audio.xc b/module_usb_audio/audio.xc index 744b8f70..dd82c037 100755 --- a/module_usb_audio/audio.xc +++ b/module_usb_audio/audio.xc @@ -29,12 +29,6 @@ static unsigned samplesOut[NUM_USB_CHAN_OUT]; static unsigned samplesIn_0[NUM_USB_CHAN_IN]; static unsigned samplesIn_1[I2S_CHANS_ADC]; -#ifdef I2S_MODE_TDM -#define I2S_CHANS_PER_FRAME 8 -#else -#define I2S_CHANS_PER_FRAME 2 -#endif - #if (DSD_CHANS_DAC != 0) extern buffered out port:32 p_dsd_dac[DSD_CHANS_DAC]; extern buffered out port:32 p_dsd_clk; @@ -42,7 +36,6 @@ extern buffered out port:32 p_dsd_clk; unsigned g_adcVal = 0; - #ifdef XTA_TIMING_AUDIO #pragma xta command "add exclusion received_command" #pragma xta command "analyse path i2s_output_l i2s_output_r" diff --git a/module_usb_audio/devicedefines.h b/module_usb_audio/devicedefines.h index 7ca77aff..08012067 100644 --- a/module_usb_audio/devicedefines.h +++ b/module_usb_audio/devicedefines.h @@ -101,6 +101,20 @@ #endif #endif +/** + * @brief Channels per I2S frame. * + * + * Default: 2 i.e standard stereo I2S (8 if using TDM i.e. I2S_MODE_TDM). + * + **/ +#ifndef I2S_CHANS_PER_FRAME +#ifdef I2S_MODE_TDM +#define I2S_CHANS_PER_FRAME 8 +#else +#define I2S_CHANS_PER_FRAME 2 +#endif +#endif + /** * @brief Max supported sample frequency for device (Hz). Default: 192000 */