shared/tinyusb: Support HS endpoint sizes.

Set buffer and endpoint sizes to 512 if the device is configured as a High
Speed device.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
This commit is contained in:
iabdalkader 2023-04-18 14:21:11 +02:00 committed by Damien George
parent 09a2ee8e7f
commit 0a3264ba96
2 changed files with 5 additions and 3 deletions

View File

@ -34,7 +34,7 @@
#include "mp_usbd_internal.h"
#define USBD_CDC_CMD_MAX_SIZE (8)
#define USBD_CDC_IN_OUT_MAX_SIZE (64)
#define USBD_CDC_IN_OUT_MAX_SIZE ((CFG_TUD_MAX_SPEED == OPT_MODE_HIGH_SPEED) ? 512 : 64)
const tusb_desc_device_t mp_usbd_desc_device_static = {
.bLength = sizeof(tusb_desc_device_t),

View File

@ -43,7 +43,9 @@
#define MICROPY_HW_USB_CDC_INTERFACE_STRING "Board CDC"
#endif
#ifndef CFG_TUSB_RHPORT0_MODE
#define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE)
#endif
#if MICROPY_HW_USB_CDC
#define CFG_TUD_CDC (1)
@ -59,8 +61,8 @@
// CDC Configuration
#if CFG_TUD_CDC
#define CFG_TUD_CDC_RX_BUFSIZE (256)
#define CFG_TUD_CDC_TX_BUFSIZE (256)
#define CFG_TUD_CDC_RX_BUFSIZE ((CFG_TUD_MAX_SPEED == OPT_MODE_HIGH_SPEED) ? 512 : 256)
#define CFG_TUD_CDC_TX_BUFSIZE ((CFG_TUD_MAX_SPEED == OPT_MODE_HIGH_SPEED) ? 512 : 256)
#endif
// MSC Configuration