summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorhathach <[email protected]>2024-05-20 17:26:04 +0700
committerhathach <[email protected]>2024-05-20 17:26:04 +0700
commitb19295c1c15de676e7cebd5bd5b6aa53887c6a56 (patch)
tree9ebb74af76ea517ba4c48225bef83861783cd693 /src/common
parent4a5fee503b1e3783301cde9b605ef30052623327 (diff)
use correct wch usbhs, usbfs for ch32v307 using CFG_TUD_MAX_SPEED
Diffstat (limited to 'src/common')
-rw-r--r--src/common/tusb_mcu.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/common/tusb_mcu.h b/src/common/tusb_mcu.h
index e313fea05..d928e44e8 100644
--- a/src/common/tusb_mcu.h
+++ b/src/common/tusb_mcu.h
@@ -404,14 +404,22 @@
//------------- WCH -------------//
#elif TU_CHECK_MCU(OPT_MCU_CH32V307)
- #define TUP_DCD_ENDPOINT_MAX 8
-// #define TUP_RHPORT_HIGHSPEED 1
+ // v307 support both FS and HS
+ #define TUP_USBIP_WCH_USBHS
+ #define TUP_USBIP_WCH_USBFS
+
+ #define TUP_RHPORT_HIGHSPEED 1 // default to highspeed
+ #define TUP_DCD_ENDPOINT_MAX (CFG_TUD_MAX_SPEED == OPT_MODE_HIGH_SPEED ? 16 : 8)
#elif TU_CHECK_MCU(OPT_MCU_CH32F20X)
- #define TUP_DCD_ENDPOINT_MAX 16
- #define TUP_RHPORT_HIGHSPEED 1
+ #define TUP_USBIP_WCH_USBHS
+ #define TUP_USBIP_WCH_USBFS
+
+ #define TUP_RHPORT_HIGHSPEED 1 // default to highspeed
+ #define TUP_DCD_ENDPOINT_MAX (CFG_TUD_MAX_SPEED == OPT_MODE_HIGH_SPEED ? 16 : 8)
#elif TU_CHECK_MCU(OPT_MCU_CH32V20X)
+ #define TUP_USBIP_WCH_USBFS
#define TUP_DCD_ENDPOINT_MAX 8
#endif