diff options
| author | mickabrig7 <[email protected]> | 2026-04-28 12:24:00 +0900 |
|---|---|---|
| committer | mickabrig7 <[email protected]> | 2026-04-28 12:24:00 +0900 |
| commit | 7258db344e99398a5e10f4c65b24d38c6b94b92b (patch) | |
| tree | 6ccce6f1fe1ab39cef994ddade3eb9b43f4d97d7 /src | |
| parent | 4c7fd70e53b34bf63ef9334f2b5624cac48299f1 (diff) | |
fix(dcd_ch32_usbfs): fix dropped bulk OUT packets by properly re-arming EP_RX_CTRL state
Diffstat (limited to 'src')
| -rw-r--r-- | src/portable/wch/dcd_ch32_usbfs.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/portable/wch/dcd_ch32_usbfs.c b/src/portable/wch/dcd_ch32_usbfs.c index 5cd25e33e..39c1cfb4a 100644 --- a/src/portable/wch/dcd_ch32_usbfs.c +++ b/src/portable/wch/dcd_ch32_usbfs.c @@ -118,6 +118,9 @@ static void update_out(uint8_t rhport, uint8_t ep, size_t rx_len) { if (ep == 0) { EP_RX_CTRL(0) = USBFS_EP_R_RES_ACK; + } else { + EP_RX_CTRL(ep) = (EP_RX_CTRL(ep) & ~USBFS_EP_R_RES_MASK) | + (xfer->valid ? USBFS_EP_R_RES_ACK : USBFS_EP_R_RES_NAK); } } } @@ -312,6 +315,8 @@ bool dcd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t t if (dir == TUSB_DIR_IN) { update_in(rhport, ep, true); + } else { + EP_RX_CTRL(ep) = (EP_RX_CTRL(ep) & ~USBFS_EP_R_RES_MASK) | USBFS_EP_R_RES_ACK; } return true; } |
