diff options
| author | FanhuaCloud <[email protected]> | 2025-07-03 14:09:10 +0800 |
|---|---|---|
| committer | sakumisu <[email protected]> | 2025-07-03 16:15:08 +0800 |
| commit | 739db92ef0791aecce7429d6bbf9b7b24da8f0fd (patch) | |
| tree | b6eaecf0d981b68d1751eb7ddb8a069001221cde | |
| parent | 53e42e6ceb18d9df08ba51e4aa0cd05c6f8fd9f9 (diff) | |
fix:(port/ch58x/usb_ch58x_dc_usbfs.c) fix out endpoint cannot receive bug
| -rw-r--r-- | port/ch32/ch58x/usb_ch58x_dc_usbfs.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/port/ch32/ch58x/usb_ch58x_dc_usbfs.c b/port/ch32/ch58x/usb_ch58x_dc_usbfs.c index c7efb84e..e86f4188 100644 --- a/port/ch32/ch58x/usb_ch58x_dc_usbfs.c +++ b/port/ch32/ch58x/usb_ch58x_dc_usbfs.c @@ -543,11 +543,10 @@ void USBD_IRQHandler(uint8_t busid) } break; case UIS_TOKEN_OUT: - EPn_SET_RX_NAK(epid); - if (epid == 0) { /*!< ep0 out */ CH58x_USBFS_DEV->UEP0_CTRL ^= RB_UEP_R_TOG; + EPn_SET_RX_NAK(epid); uint32_t read_count = EPn_GET_RX_LEN(0); memcpy(usb_dc_cfg.ep_out[epid].xfer_buf, usb_dc_cfg.ep_out[epid].ep_ram_addr, read_count); @@ -563,6 +562,7 @@ void USBD_IRQHandler(uint8_t busid) if (epid == 4) { CH58x_USBFS_DEV->UEP4_CTRL ^= RB_UEP_R_TOG; } + EPn_SET_RX_NAK(epid); uint32_t read_count = EPn_GET_RX_LEN(epid); memcpy(usb_dc_cfg.ep_out[epid].xfer_buf, usb_dc_cfg.ep_out[epid].ep_ram_addr, read_count); usb_dc_cfg.ep_out[epid].xfer_buf += read_count; @@ -637,4 +637,4 @@ void USB_IRQHandler(void) { extern void USBD_IRQHandler(uint8_t busid); USBD_IRQHandler(0); -}
\ No newline at end of file +} |
