From 3ce7dbcd6e62e76e2ebb6eef4d01ee55d45d617d Mon Sep 17 00:00:00 2001 From: Andrew Leech Date: Wed, 7 Aug 2024 20:28:31 +1000 Subject: [PATCH] shared/tinyusb: Improve configuration for high speed usb. Signed-off-by: Andrew Leech --- shared/tinyusb/tusb_config.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/shared/tinyusb/tusb_config.h b/shared/tinyusb/tusb_config.h index 1f8f5e5f6dc5..11220ff4ba94 100644 --- a/shared/tinyusb/tusb_config.h +++ b/shared/tinyusb/tusb_config.h @@ -59,8 +59,25 @@ #define MICROPY_HW_USB_MSC_INQUIRY_REVISION_STRING "1.00" #endif +#if MICROPY_HW_USB_HS +#define OPT_MODE_PORT_SPEED OPT_MODE_HIGH_SPEED +#else +#define OPT_MODE_PORT_SPEED OPT_MODE_FULL_SPEED +#endif + +#ifndef BOARD_DEVICE_RHPORT_NUM +#define BOARD_DEVICE_RHPORT_NUM 0 +#endif + +#ifndef BOARD_DEVICE_RHPORT_SPEED +#define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_PORT_SPEED +#endif +#ifndef CFG_TUD_MAX_SPEED +#define CFG_TUD_MAX_SPEED OPT_MODE_PORT_SPEED +#endif + #ifndef CFG_TUSB_RHPORT0_MODE -#define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE) +#define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED) #endif #if MICROPY_HW_USB_CDC