From 98cf4a320863a35fb509f0f8e5bf15624ac26054 Mon Sep 17 00:00:00 2001 From: Ross Owen Date: Wed, 22 Jan 2014 21:53:57 +0000 Subject: [PATCH] MAX_FREQ_A1 define now MAX_FREQ_FS. Also limited to 48k when input and output enabled (96k otherwise) --- module_usb_audio/devicedefines.h | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/module_usb_audio/devicedefines.h b/module_usb_audio/devicedefines.h index d1420956..8eebcfed 100644 --- a/module_usb_audio/devicedefines.h +++ b/module_usb_audio/devicedefines.h @@ -60,12 +60,6 @@ #define MIN_FREQ_44 (((44100*512)/((48000 * 512)/MIN_FREQ))*2) #endif -#if (MAX_FREQ > 96000) -#define MAX_FREQ_A1 96000 -#else -#define MAX_FREQ_A1 MAX_FREQ -#endif - /* For Audio Class 1.0 and Full-speed Audio 2.0 we always have at most 2 channels */ #if (NUM_USB_CHAN_OUT > 2) #define NUM_USB_CHAN_OUT_FS (2) @@ -79,9 +73,22 @@ #define NUM_USB_CHAN_IN_FS (NUM_USB_CHAN_IN) #endif -/* Channel count defines for Audio 1.0 mode */ -//#define NUM_USB_CHAN_OUT_A1 (NUM_USB_CHAN_OUT_FS) -//#define NUM_USB_CHAN_IN_A1 (NUM_USB_CHAN_IN_FS) +/* Apply sample-rate restrictions to full-speed operation */ +#if (NUM_USB_CHAN_OUT_FS > 0) && (NUM_USB_CHAN_IN_FS > 0) + #if(MAX_FREQ > 48000) + #define MAX_FREQ_FS 48000 + #else + #define MAX_FREQ_FS MAX_FREQ + #endif +#else + #if (MAX_FREQ > 96000) + #define MAX_FREQ_FS 96000 + #else + #define MAX_FREQ_FS MAX_FREQ + #endif +#endif + + #if defined(IO_EXPANSION) && (IO_EXPANSION == 0)