fix warning and add speed errorout when precompile

This commit is contained in:
sakumisu
2022-07-07 21:33:56 +08:00
parent 174a07fb89
commit 76887cf682
2 changed files with 5 additions and 1 deletions

View File

@@ -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

View File

@@ -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;