summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorhathach <[email protected]>2024-05-24 13:58:44 +0700
committerhathach <[email protected]>2024-05-24 13:58:44 +0700
commit4ce439a75a6f7aa995c74e7ac32e70ab8216c771 (patch)
treea1bed9351159f79f09de0c9a906c0dfb915686c5 /src/common
parent927015baae9b2d265d1daaa0fc2ffca1aa4f9e91 (diff)
add ch32 support for fsdev driver. v20x can select fsdev or usbfs with make/cmake PORT=0/1. default to fsdev
Diffstat (limited to 'src/common')
-rw-r--r--src/common/tusb_compiler.h1
-rw-r--r--src/common/tusb_mcu.h5
2 files changed, 4 insertions, 2 deletions
diff --git a/src/common/tusb_compiler.h b/src/common/tusb_compiler.h
index 0d5570b1c..ce5566ffe 100644
--- a/src/common/tusb_compiler.h
+++ b/src/common/tusb_compiler.h
@@ -128,6 +128,7 @@
#define TU_ATTR_SECTION(sec_name) __attribute__ ((section(#sec_name)))
#define TU_ATTR_PACKED __attribute__ ((packed))
#define TU_ATTR_WEAK __attribute__ ((weak))
+ // #define TU_ATTR_WEAK_ALIAS(f) __attribute__ ((weak, alias(#f))
#ifndef TU_ATTR_ALWAYS_INLINE // allow to override for debug
#define TU_ATTR_ALWAYS_INLINE __attribute__ ((always_inline))
#endif
diff --git a/src/common/tusb_mcu.h b/src/common/tusb_mcu.h
index af11ecb9b..c66996c4f 100644
--- a/src/common/tusb_mcu.h
+++ b/src/common/tusb_mcu.h
@@ -423,7 +423,6 @@
#elif TU_CHECK_MCU(OPT_MCU_CH32V20X)
// v20x support both FSDEV (USBD) and USBFS, default to FSDEV
#define TUP_USBIP_WCH_USBFS
- #define TUP_DCD_ENDPOINT_MAX 8
#define TUP_USBIP_FSDEV
#define TUP_USBIP_FSDEV_CH32
@@ -431,10 +430,12 @@
#define CFG_TUD_WCH_USBIP_USBFS 0
#endif
- #if !defined(CFG_TUD_WCH_FSDEV)
+ #if !defined(CFG_TUD_WCH_USBIP_FSDEV)
#define CFG_TUD_WCH_USBIP_FSDEV (CFG_TUD_WCH_USBIP_USBFS ? 0 : 1)
#endif
+ #define TUP_DCD_ENDPOINT_MAX 8
+
#elif TU_CHECK_MCU(OPT_MCU_CH32V307)
// v307 support both FS and HS, default to HS
#define TUP_USBIP_WCH_USBHS