Skip to content

Commit 4748488

Browse files
committed
shared/tinyusb: Improve configuration for high speed usb.
Signed-off-by: Andrew Leech <[email protected]>
1 parent 5bee790 commit 4748488

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

shared/tinyusb/tusb_config.h

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,25 @@
5959
#define MICROPY_HW_USB_MSC_INQUIRY_REVISION_STRING "1.00"
6060
#endif
6161

62+
#if MICROPY_HW_USB_HS
63+
#define OPT_MODE_PORT_SPEED OPT_MODE_HIGH_SPEED
64+
#else
65+
#define OPT_MODE_PORT_SPEED OPT_MODE_FULL_SPEED
66+
#endif
67+
68+
#ifndef BOARD_DEVICE_RHPORT_NUM
69+
#define BOARD_DEVICE_RHPORT_NUM 0
70+
#endif
71+
72+
#ifndef BOARD_DEVICE_RHPORT_SPEED
73+
#define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_PORT_SPEED
74+
#endif
75+
#ifndef CFG_TUD_MAX_SPEED
76+
#define CFG_TUD_MAX_SPEED OPT_MODE_PORT_SPEED
77+
#endif
78+
6279
#ifndef CFG_TUSB_RHPORT0_MODE
63-
#define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE)
80+
#define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED)
6481
#endif
6582

6683
#if MICROPY_HW_USB_CDC

0 commit comments

Comments
 (0)