Skip to content

Commit 05dbc11

Browse files
authored
update stdio_usb CDC constants to the defaults used by TinyUSB, and allow the user to override them (raspberrypi#2246)
1 parent 396aa06 commit 05dbc11

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/rp2_common/pico_stdio_usb/include/tusb_config.h

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,19 @@
3333
#define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE)
3434

3535
#define CFG_TUD_CDC (1)
36-
#define CFG_TUD_CDC_RX_BUFSIZE (256)
37-
#define CFG_TUD_CDC_TX_BUFSIZE (256)
36+
37+
// CDC FIFO size of TX and RX
38+
#ifndef CFG_TUD_CDC_RX_BUFSIZE
39+
#define CFG_TUD_CDC_RX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
40+
#endif
41+
#ifndef CFG_TUD_CDC_TX_BUFSIZE
42+
#define CFG_TUD_CDC_TX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
43+
#endif
44+
45+
// CDC Endpoint transfer buffer size, more is faster
46+
#ifndef CFG_TUD_CDC_EP_BUFSIZE
47+
#define CFG_TUD_CDC_EP_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
48+
#endif
3849

3950
// We use a vendor specific interface but with our own driver
4051
// Vendor driver only used for Microsoft OS 2.0 descriptor

0 commit comments

Comments
 (0)