From 5a8ae31316ed30937e910e376dc6f62e8e4e3433 Mon Sep 17 00:00:00 2001 From: Peter Lawrence <12226419+majbthrd@users.noreply.github.com> Date: Tue, 23 Feb 2021 10:08:38 -0600 Subject: [PATCH] rp2040: leverage existing macro for capping endpoints in pico-sdk --- src/portable/raspberrypi/rp2040/dcd_rp2040.c | 4 ++-- src/portable/raspberrypi/rp2040/rp2040_usb.h | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/portable/raspberrypi/rp2040/dcd_rp2040.c b/src/portable/raspberrypi/rp2040/dcd_rp2040.c index d329d40c3..9c43b6fdb 100644 --- a/src/portable/raspberrypi/rp2040/dcd_rp2040.c +++ b/src/portable/raspberrypi/rp2040/dcd_rp2040.c @@ -48,8 +48,8 @@ // Init these in dcd_init static uint8_t *next_buffer_ptr; -// Endpoints 0-TUD_OPT_RP2040_USB_MAX_ENDPOINTS, direction 0 for out and 1 for in. -static struct hw_endpoint hw_endpoints[TUD_OPT_RP2040_USB_MAX_ENDPOINTS][2] = {0}; +// USB_MAX_ENDPOINTS Endpoints, direction 0 for out and 1 for in. +static struct hw_endpoint hw_endpoints[USB_MAX_ENDPOINTS][2] = {0}; static inline struct hw_endpoint *hw_endpoint_get_by_num(uint8_t num, uint8_t in) { diff --git a/src/portable/raspberrypi/rp2040/rp2040_usb.h b/src/portable/raspberrypi/rp2040/rp2040_usb.h index be9b507c2..522d7d701 100644 --- a/src/portable/raspberrypi/rp2040/rp2040_usb.h +++ b/src/portable/raspberrypi/rp2040/rp2040_usb.h @@ -16,10 +16,6 @@ #define TUD_OPT_RP2040_USB_DEVICE_ENUMERATION_FIX PICO_RP2040_USB_DEVICE_ENUMERATION_FIX #endif -#if !defined(TUD_OPT_RP2040_USB_MAX_ENDPOINTS) -#define TUD_OPT_RP2040_USB_MAX_ENDPOINTS 16 -#endif - // For memset #include