Skip to content

Commit eb9539b

Browse files
committed
fix(dcd_dwc2): Reset allocated_epin_count on bus reset and close all ep
1 parent ea4e59d commit eb9539b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/portable/synopsys/dwc2/dcd_dwc2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ void dcd_edpt_close_all(uint8_t rhport) {
543543
dwc2_regs_t* dwc2 = DWC2_REG(rhport);
544544
uint8_t const ep_count = _dwc2_controller[rhport].ep_count;
545545

546-
_dcd_data.allocated_epin_count = 1;
546+
_dcd_data.allocated_epin_count = 0;
547547

548548
// Disable non-control interrupt
549549
dwc2->daintmsk = (1 << DAINTMSK_OEPM_Pos) | (1 << DAINTMSK_IEPM_Pos);
@@ -654,7 +654,7 @@ static void handle_bus_reset(uint8_t rhport) {
654654
tu_memclr(xfer_status, sizeof(xfer_status));
655655

656656
_dcd_data.sof_en = false;
657-
_dcd_data.allocated_epin_count = 1;
657+
_dcd_data.allocated_epin_count = 0;
658658

659659
// 1. NAK for all OUT endpoints
660660
for (uint8_t n = 0; n < ep_count; n++) {

0 commit comments

Comments
 (0)