Skip to content

Commit 9c10fe8

Browse files
committed
define fix
1 parent 173e452 commit 9c10fe8

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/arduino/ports/ch32/Adafruit_TinyUSB_ch32.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ USBWakeUp_IRQHandler(void) {
6060
// USBFS
6161
#if CFG_TUD_WCH_USBIP_USBFS
6262

63-
#if defined(CH32V10x) || defined(CH32V20x)
63+
#if defined(CH32V10x) || defined(CH32V20x) || defined(CH32L10x)
6464

6565
#if defined(CH32V10x)
6666
#define USBHDWakeUp_IRQHandler USBWakeUp_IRQHandler
@@ -115,6 +115,9 @@ void TinyUSB_Port_InitDevice(uint8_t rhport) {
115115
EXTEN->EXTEN_CTR &= ~EXTEN_USB_5V_SEL;
116116

117117
#define RCC_AHBPeriph_OTG_FS RCC_AHBPeriph_USBHD
118+
#elif defined(CH32L10x)
119+
#define RCC_AHBPeriph_OTG_FS RCC_HBPeriph_USBFS
120+
#define RCC_AHBPeriphClockCmd RCC_HBPeriphClockCmd
118121
#endif
119122

120123
uint8_t usb_div;
@@ -162,10 +165,6 @@ void TinyUSB_Port_InitDevice(uint8_t rhport) {
162165
#endif
163166

164167
#if CFG_TUD_WCH_USBIP_USBFS
165-
#if defined(CH32L10x)
166-
#define RCC_AHBPeriph_OTG_FS RCC_HBPeriph_USBFS
167-
#define RCC_AHBPeriphClockCmd RCC_HBPeriphClockCmd
168-
#endif
169168
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_OTG_FS, ENABLE);
170169
#endif
171170
#endif

0 commit comments

Comments
 (0)