From 2b9367322d537a28f373d5338702aaf95fd1b842 Mon Sep 17 00:00:00 2001 From: Ross Owen Date: Tue, 1 Dec 2015 13:10:28 +0000 Subject: [PATCH] Added build error if NUM_USB_CHAN_IN/OUT_FS > NUM_USB_CHAN_IN/OUT --- module_usb_audio/warnings.xc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/module_usb_audio/warnings.xc b/module_usb_audio/warnings.xc index e85973a6..5cbab76f 100644 --- a/module_usb_audio/warnings.xc +++ b/module_usb_audio/warnings.xc @@ -61,4 +61,13 @@ Warnings relating to configuration defines located in this XC source file rather #warning AUDIO_CLASS_FALLBACK not defined, using 0 (i.e. disabled) #endif +/* Sanity check on FS channel counts */ +#if (NUM_USB_CHAN_OUT_FS > NUM_USB_CHAN_OUT) +#error NUM_USB_CHAN_OUT expected to be less than or equal to NUM_USB_CHAN_OUT +#endif + +#if (NUM_USB_CHAN_IN_FS > NUM_USB_CHAN_IN) +#error NUM_USB_CHAN_IN expected to be less than or equal to NUM_USB_CHAN_IN +#endif +