From d2fb9b36246dc1285c29a8581b3a3b58cb213f1e Mon Sep 17 00:00:00 2001 From: 张承儒 Date: Fri, 22 Jul 2022 18:31:13 +0800 Subject: fixed a bug on USB interrupt handler --- port/ch32/usb_dc_ch58x.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/port/ch32/usb_dc_ch58x.c b/port/ch32/usb_dc_ch58x.c index 411efd4e..c06771f5 100644 --- a/port/ch32/usb_dc_ch58x.c +++ b/port/ch32/usb_dc_ch58x.c @@ -12,7 +12,8 @@ #include "usb_dc.h" #include "usbd_core.h" -#include "./usb_ch58x_reg.h" +#include "usb_ch58x_reg.h" +#include "CH58x_common.h" #include /** @@ -447,6 +448,9 @@ int usb_dc_init(void) R8_UDEV_CTRL = RB_UD_PD_DIS | RB_UD_PORT_EN; /*!< Allow USB port */ R8_USB_INT_EN = RB_UIE_SUSPEND | RB_UIE_BUS_RST | RB_UIE_TRANSFER; + DelayUs(100); + PFIC_EnableIRQ(USB_IRQn); + return 0; } @@ -456,7 +460,9 @@ int usb_dc_init(void) * @param[in] None * @retval None */ -void usb_isr_handler(void) +__INTERRUPT +__HIGH_CODE +void USB_IRQHandler(void) { UINT8 intflag = 0; intflag = R8_USB_INT_FG; -- cgit v1.3.1