summaryrefslogtreecommitdiff
path: root/src/portable
diff options
context:
space:
mode:
authorpoornadharshan13-rgb <[email protected]>2025-10-10 10:20:19 +0530
committerpoornadharshan13-rgb <[email protected]>2025-10-10 10:20:19 +0530
commitaa0fc2e08f1c2dd6f026a431e8989357fbb4c5bf (patch)
treedbe99b7878c2bd022b074bffacffa725e323b654 /src/portable
parent8f2e3ed4418a08cc13aee4527b7bdd1b8bb1bf55 (diff)
successfully
Diffstat (limited to 'src/portable')
-rw-r--r--src/portable/synopsys/dwc2/dcd_dwc2.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/portable/synopsys/dwc2/dcd_dwc2.c b/src/portable/synopsys/dwc2/dcd_dwc2.c
index 9d9172b67..e3c21a86d 100644
--- a/src/portable/synopsys/dwc2/dcd_dwc2.c
+++ b/src/portable/synopsys/dwc2/dcd_dwc2.c
@@ -814,17 +814,18 @@ static void handle_rxflvl_irq(uint8_t rhport) {
dfifo_read_packet(dwc2, xfer->buffer, byte_count);
xfer->buffer += byte_count;
}
+ }
- // short packet, minus remaining bytes (xfer_size)
- if (byte_count < xfer->max_size) {
- const dwc2_ep_tsize_t tsiz = {.value = epout->tsiz};
- xfer->total_len -= tsiz.xfer_size;
- if (epnum == 0) {
- xfer->total_len -= _dcd_data.ep0_pending[TUSB_DIR_OUT];
- _dcd_data.ep0_pending[TUSB_DIR_OUT] = 0;
- }
+ // short packet (including ZLP when byte_count == 0), minus remaining bytes (xfer_size)
+ if (byte_count < xfer->max_size) {
+ const dwc2_ep_tsize_t tsiz = {.value = epout->tsiz};
+ xfer->total_len -= tsiz.xfer_size;
+ if (epnum == 0) {
+ xfer->total_len -= _dcd_data.ep0_pending[TUSB_DIR_OUT];
+ _dcd_data.ep0_pending[TUSB_DIR_OUT] = 0;
}
}
+
break;
}