diff --git a/port/ch32/usb_dc_usbfs.c b/port/ch32/usb_dc_usbfs.c index b7eec7e0..f8258f71 100644 --- a/port/ch32/usb_dc_usbfs.c +++ b/port/ch32/usb_dc_usbfs.c @@ -1,6 +1,10 @@ #include "usbd_core.h" #include "usb_ch32_usbfs_reg.h" +#ifdef CONFIG_USB_HS +#error "usb fs do not support hs" +#endif + #ifndef USBD_IRQHandler #define USBD_IRQHandler OTG_FS_IRQHandler //use actual usb irq name instead #endif diff --git a/port/ch32/usb_dc_usbhs.c b/port/ch32/usb_dc_usbhs.c index 0e018fcd..2a43ac42 100644 --- a/port/ch32/usb_dc_usbhs.c +++ b/port/ch32/usb_dc_usbhs.c @@ -69,7 +69,7 @@ int usb_dc_init(void) USBHS_DEVICE->HOST_CTRL = USBHS_PHY_SUSPENDM; USBHS_DEVICE->CONTROL = 0; -#if CONFIG_USB_HS +#ifdef CONFIG_USB_HS USBHS_DEVICE->CONTROL = USBHS_DMA_EN | USBHS_INT_BUSY_EN | USBHS_HIGH_SPEED; #else USBHS_DEVICE->CONTROL = USBHS_DMA_EN | USBHS_INT_BUSY_EN | USBHS_FULL_SPEED;