Skip to content

Commit 741fdaa

Browse files
committed
fix(dcd_dwc2): Reset allocated_epin_count on bus reset and close all ep
1 parent 6b36df3 commit 741fdaa

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
@@ -539,7 +539,7 @@ void dcd_edpt_close_all(uint8_t rhport) {
539539
dwc2_regs_t* dwc2 = DWC2_REG(rhport);
540540
uint8_t const ep_count = _dwc2_controller[rhport].ep_count;
541541

542-
_dcd_data.allocated_epin_count = 1;
542+
_dcd_data.allocated_epin_count = 0;
543543

544544
// Disable non-control interrupt
545545
dwc2->daintmsk = (1 << DAINTMSK_OEPM_Pos) | (1 << DAINTMSK_IEPM_Pos);
@@ -646,7 +646,7 @@ static void handle_bus_reset(uint8_t rhport) {
646646
tu_memclr(xfer_status, sizeof(xfer_status));
647647

648648
_dcd_data.sof_en = false;
649-
_dcd_data.allocated_epin_count = 1;
649+
_dcd_data.allocated_epin_count = 0;
650650

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

0 commit comments

Comments
 (0)