summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsakumisu <[email protected]>2025-02-25 22:16:09 +0800
committersakumisu <[email protected]>2025-02-25 22:16:09 +0800
commitdb0f5475b4ada7fde20aeb3dd1742c8124cd7db1 (patch)
tree4cbfd6b02298edb396a5961382467335aa36d029
parent27c307abed8449e2f0b9a12b9d88bbd951be46b6 (diff)
fix(port/ch32): add EPn_SET_TX_LEN for mps
Signed-off-by: sakumisu <[email protected]>
-rw-r--r--port/ch32/usb_ch58x_dc_usbfs.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/port/ch32/usb_ch58x_dc_usbfs.c b/port/ch32/usb_ch58x_dc_usbfs.c
index ce3cfe1f..5771efb6 100644
--- a/port/ch32/usb_ch58x_dc_usbfs.c
+++ b/port/ch32/usb_ch58x_dc_usbfs.c
@@ -531,6 +531,7 @@ USBD_IRQHandler(void)
usb_dc_cfg.ep_in[epid].actual_xfer_len += usb_dc_cfg.ep_in[epid].mps;
if (usb_dc_cfg.ep_in[epid].xfer_len > usb_dc_cfg.ep_in[epid].mps) {
memcpy(usb_dc_cfg.ep_in[epid].ep_ram_addr, usb_dc_cfg.ep_in[epid].xfer_buf, usb_dc_cfg.ep_in[epid].mps);
+ EPn_SET_TX_LEN(epid, usb_dc_cfg.ep_in[epid].mps);
} else {
memcpy(usb_dc_cfg.ep_in[epid].ep_ram_addr, usb_dc_cfg.ep_in[epid].xfer_buf, usb_dc_cfg.ep_in[epid].xfer_len);
EPn_SET_TX_LEN(epid, usb_dc_cfg.ep_in[epid].xfer_len);