summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthew Tran <[email protected]>2024-05-17 09:52:06 -0700
committerMatthew Tran <[email protected]>2024-05-19 21:50:30 -0700
commitab5f2768773634efe8c79add7e009e2e2ca63279 (patch)
tree397ceeeed64add63bd656b904dbb120c637ed7ba /src
parent2a67ce773dcd68f7f8c4c07fce2e6e4f7947e03d (diff)
fix ep0 stall not clearing
Diffstat (limited to 'src')
-rw-r--r--src/portable/wch/dcd_ch32_usbfs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/portable/wch/dcd_ch32_usbfs.c b/src/portable/wch/dcd_ch32_usbfs.c
index 83f625e21..3af3ff6d7 100644
--- a/src/portable/wch/dcd_ch32_usbfs.c
+++ b/src/portable/wch/dcd_ch32_usbfs.c
@@ -148,6 +148,8 @@ void dcd_int_handler(uint8_t rhport) {
case PID_SETUP:
data.ep0_tog = true;
+ dcd_edpt_clear_stall(rhport, tu_edpt_addr(0, TUSB_DIR_IN)); // setup clears stall
+ dcd_edpt_clear_stall(rhport, tu_edpt_addr(0, TUSB_DIR_OUT));
dcd_event_setup_received(rhport, &data.buffer[0][TUSB_DIR_OUT][0], true);
break;
}
@@ -261,10 +263,12 @@ bool dcd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t *buffer, uint16_t to
uint8_t dir = tu_edpt_dir(ep_addr);
struct usb_xfer *xfer = &data.xfer[ep][dir];
+ dcd_int_disable(rhport);
xfer->valid = true;
xfer->buffer = buffer;
xfer->len = total_bytes;
xfer->processed_len = 0;
+ dcd_int_enable(rhport);
if (dir == TUSB_DIR_IN) {
update_in(rhport, ep, true);