From 9c10fe81b674fd417c4acd4dfae550dafac41c58 Mon Sep 17 00:00:00 2001 From: Koki Mizumoto <21km43@gmail.com> Date: Thu, 12 Sep 2024 16:12:48 +0900 Subject: [PATCH] define fix --- src/arduino/ports/ch32/Adafruit_TinyUSB_ch32.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/arduino/ports/ch32/Adafruit_TinyUSB_ch32.cpp b/src/arduino/ports/ch32/Adafruit_TinyUSB_ch32.cpp index b3060aca..e1aa29b7 100644 --- a/src/arduino/ports/ch32/Adafruit_TinyUSB_ch32.cpp +++ b/src/arduino/ports/ch32/Adafruit_TinyUSB_ch32.cpp @@ -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 @@ -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; @@ -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