diff options
| author | sakumisu <[email protected]> | 2022-07-07 21:33:56 +0800 |
|---|---|---|
| committer | sakumisu <[email protected]> | 2022-07-07 21:33:56 +0800 |
| commit | 76887cf68204302613291471c481fd7c5b5b588d (patch) | |
| tree | 8024f42972c7b351ebfcf6892a205c1123e5e12c | |
| parent | 174a07fb898291e0ca2e8dadc4384d3962de1320 (diff) | |
fix warning and add speed errorout when precompile
| -rw-r--r-- | port/ch32/usb_dc_usbfs.c | 4 | ||||
| -rw-r--r-- | port/ch32/usb_dc_usbhs.c | 2 |
2 files changed, 5 insertions, 1 deletions
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; |
