summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2024-11-29 14:07:30 +0700
committerGitHub <[email protected]>2024-11-29 14:07:30 +0700
commit2179fb1bd93b71d755c4bf212aff7094f5e8337d (patch)
treed221a8367aa3ec5a3aa47b866af45ec814549db2 /src
parent444277f4a2d841df0112eb9a24c0bdf1aef6b55b (diff)
parent239443c197c34f0f51a4ff7839b25985ccbb48ad (diff)
Merge pull request #2891 from roma-jam/fix/dcd_dwc2_counters
fix(dcd_dwc2): Fix EP IN counters assignment and usage
Diffstat (limited to 'src')
-rw-r--r--src/portable/synopsys/dwc2/dcd_dwc2.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/portable/synopsys/dwc2/dcd_dwc2.c b/src/portable/synopsys/dwc2/dcd_dwc2.c
index 63d2e5bb1..bde48ef57 100644
--- a/src/portable/synopsys/dwc2/dcd_dwc2.c
+++ b/src/portable/synopsys/dwc2/dcd_dwc2.c
@@ -192,8 +192,8 @@ static bool dfifo_alloc(uint8_t rhport, uint8_t ep_addr, uint16_t packet_size) {
}
} else {
// Check IN endpoints concurrently active limit
- if(_dwc2_controller->ep_in_count) {
- TU_ASSERT(_dcd_data.allocated_epin_count < _dwc2_controller->ep_in_count);
+ if(dwc2_controller->ep_in_count) {
+ TU_ASSERT(_dcd_data.allocated_epin_count < dwc2_controller->ep_in_count);
_dcd_data.allocated_epin_count++;
}
@@ -539,7 +539,7 @@ void dcd_edpt_close_all(uint8_t rhport) {
dwc2_regs_t* dwc2 = DWC2_REG(rhport);
uint8_t const ep_count = _dwc2_controller[rhport].ep_count;
- _dcd_data.allocated_epin_count = 1;
+ _dcd_data.allocated_epin_count = 0;
// Disable non-control interrupt
dwc2->daintmsk = (1 << DAINTMSK_OEPM_Pos) | (1 << DAINTMSK_IEPM_Pos);
@@ -646,7 +646,7 @@ static void handle_bus_reset(uint8_t rhport) {
tu_memclr(xfer_status, sizeof(xfer_status));
_dcd_data.sof_en = false;
- _dcd_data.allocated_epin_count = 1;
+ _dcd_data.allocated_epin_count = 0;
// 1. NAK for all OUT endpoints
for (uint8_t n = 0; n < ep_count; n++) {