diff options
| author | 张承儒 <[email protected]> | 2022-07-22 18:31:13 +0800 |
|---|---|---|
| committer | sakumisu <[email protected]> | 2022-07-24 23:09:08 +0800 |
| commit | d2fb9b36246dc1285c29a8581b3a3b58cb213f1e (patch) | |
| tree | f606b65dff103a08adae7b82a014207a298f0402 | |
| parent | 120f994ee3b6d892eda154f2053818fbcfb3fc92 (diff) | |
fixed a bug on USB interrupt handler
| -rw-r--r-- | port/ch32/usb_dc_ch58x.c | 10 |
1 files 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 <stdlib.h> /** @@ -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; |
