diff --git a/module_usb_audio/audio_io/audio_io.xc b/module_usb_audio/audio_io/audio_io.xc index e3e10b4b..ba8312f9 100755 --- a/module_usb_audio/audio_io/audio_io.xc +++ b/module_usb_audio/audio_io/audio_io.xc @@ -57,10 +57,6 @@ static unsigned samplesIn[2][MAX(NUM_USB_CHAN_IN, IN_CHAN_COUNT)]; #undef SPDIF_RX #endif -#ifndef I2S_UPSAMPLE_FACTOR_OUT -#define I2S_UPSAMPLE_FACTOR_OUT (1) -#endif - static int inDownsamplingCounter = 0; static int outUpsamplingCounter = 0; #if (I2S_DOWNSAMPLE_FACTOR_IN > 1) || (I2S_UPSAMPLE_FACTOR_OUT > 1) diff --git a/module_usb_audio/devicedefines.h b/module_usb_audio/devicedefines.h index b88d334b..a7b6a771 100644 --- a/module_usb_audio/devicedefines.h +++ b/module_usb_audio/devicedefines.h @@ -134,6 +134,19 @@ #endif #endif +/** + * @brief Outgoing I2S (host to device) channels can be upsampled by a factor of 3. + * + * Default: 1 i.e. upsampling is disabled. + */ +#ifndef I2S_UPSAMPLE_FACTOR_OUT +#define I2S_UPSAMPLE_FACTOR_OUT (1) +#else + #if (I2S_UPSAMPLE_FACTOR_OUT != 3) && (I2S_UPSAMPLE_FACTOR_OUT != 1) + #error Unsupported I2S input upsampling configuration + #endif +#endif + /** * @brief Only downsample one channel per input I2S frame. *