Skip to content

Commit

Permalink
define fix
Browse files Browse the repository at this point in the history
  • Loading branch information
21km43 committed Sep 12, 2024
1 parent 173e452 commit 9c10fe8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/arduino/ports/ch32/Adafruit_TinyUSB_ch32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ USBWakeUp_IRQHandler(void) {
// USBFS
#if CFG_TUD_WCH_USBIP_USBFS

#if defined(CH32V10x) || defined(CH32V20x)
#if defined(CH32V10x) || defined(CH32V20x) || defined(CH32L10x)

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

#define RCC_AHBPeriph_OTG_FS RCC_AHBPeriph_USBHD
#elif defined(CH32L10x)
#define RCC_AHBPeriph_OTG_FS RCC_HBPeriph_USBFS
#define RCC_AHBPeriphClockCmd RCC_HBPeriphClockCmd
#endif

uint8_t usb_div;
Expand Down Expand Up @@ -162,10 +165,6 @@ void TinyUSB_Port_InitDevice(uint8_t rhport) {
#endif

#if CFG_TUD_WCH_USBIP_USBFS
#if defined(CH32L10x)
#define RCC_AHBPeriph_OTG_FS RCC_HBPeriph_USBFS
#define RCC_AHBPeriphClockCmd RCC_HBPeriphClockCmd
#endif
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_OTG_FS, ENABLE);
#endif
#endif
Expand Down

0 comments on commit 9c10fe8

Please sign in to comment.