From 9612bc80eb0181b035b52d459f173c3c00a87c20 Mon Sep 17 00:00:00 2001 From: Devan Lai Date: Sat, 13 May 2017 10:37:22 -0700 Subject: [PATCH] Update USB PMA check to take CAN into account --- src/USB/composite_usb_conf.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/USB/composite_usb_conf.c b/src/USB/composite_usb_conf.c index 36738de..41383c9 100644 --- a/src/USB/composite_usb_conf.c +++ b/src/USB/composite_usb_conf.c @@ -66,7 +66,13 @@ _Static_assert((1 + NUM_OUT_ENDPOINTS <= 8), "Too many OUT endpoints for USB cor + CDC_PMA_USAGE \ + VCDC_PMA_USAGE) -_Static_assert((TOTAL_PMA_USAGE <= USB_PMA_SIZE), "USB packet memory area overallocated"); +#if CAN_RX_AVAILABLE && VCDC_AVAILABLE +#define MAX_USB_PMA_SIZE USB_PMA_SIZE_WITH_CAN +#else +#define MAX_USB_PMA_SIZE USB_PMA_SIZE +#endif + +_Static_assert((TOTAL_PMA_USAGE <= MAX_USB_PMA_SIZE), "USB packet memory area overallocated"); static const struct usb_device_descriptor dev = { .bLength = USB_DT_DEVICE_SIZE,