summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgab-k <[email protected]>2026-03-28 22:47:39 +0100
committergab-k <[email protected]>2026-03-28 23:04:39 +0100
commit1ebd7ebacf98c2160654c2bcb387190b54963a03 (patch)
tree9199486b13832ee2123a68558570c84bd21a0cd1 /src
parentd9b122668b71dcd94974377486e6110345cc753b (diff)
Clear DOEPCTL_USBAEP instead of setting DOEPCTL = DOEPCTL_SNAK
Diffstat (limited to 'src')
-rw-r--r--src/portable/synopsys/dwc2/dcd_dwc2.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/portable/synopsys/dwc2/dcd_dwc2.c b/src/portable/synopsys/dwc2/dcd_dwc2.c
index fe0b2492c..7a1d7dcf6 100644
--- a/src/portable/synopsys/dwc2/dcd_dwc2.c
+++ b/src/portable/synopsys/dwc2/dcd_dwc2.c
@@ -347,10 +347,10 @@ static void edpt_disable(uint8_t rhport, uint8_t ep_addr, bool stall) {
}
}
-// Force ISO OUT EP into NAK before re-activating it with a changed MPS.
+// Clear stale active-endpoint state before re-activating ISO OUT with a changed MPS.
static void edpt_iso_out_reset(uint8_t rhport, uint8_t epnum) {
dwc2_dep_t* epout = &DWC2_REG(rhport)->epout[epnum];
- epout->doepctl = DOEPCTL_SNAK;
+ epout->doepctl &= ~DOEPCTL_USBAEP;
}
// Since this function returns void, it is not possible to return a boolean success message
@@ -641,16 +641,14 @@ bool dcd_edpt_iso_activate(uint8_t rhport, tusb_desc_endpoint_t const * p_endpo
const uint8_t epnum = tu_edpt_number(ep_addr);
const uint8_t dir = tu_edpt_dir(ep_addr);
+ edpt_disable(rhport, ep_addr, false);
+
if (dir == TUSB_DIR_OUT) {
const uint16_t new_mps = tu_edpt_packet_size(p_endpoint_desc);
xfer_ctl_t* xfer = XFER_CTL_BASE(epnum, dir);
if (xfer->max_size != 0 && xfer->max_size != new_mps) {
edpt_iso_out_reset(rhport, epnum);
- } else {
- edpt_disable(rhport, ep_addr, false);
}
- } else {
- edpt_disable(rhport, ep_addr, false);
}
edpt_activate(rhport, p_endpoint_desc);