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