Merge pull request #2891 from roma-jam/fix/dcd_dwc2_counters
fix(dcd_dwc2): Fix EP IN counters assignment and usage
This commit is contained in:
@@ -192,8 +192,8 @@ static bool dfifo_alloc(uint8_t rhport, uint8_t ep_addr, uint16_t packet_size) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Check IN endpoints concurrently active limit
|
// Check IN endpoints concurrently active limit
|
||||||
if(_dwc2_controller->ep_in_count) {
|
if(dwc2_controller->ep_in_count) {
|
||||||
TU_ASSERT(_dcd_data.allocated_epin_count < _dwc2_controller->ep_in_count);
|
TU_ASSERT(_dcd_data.allocated_epin_count < dwc2_controller->ep_in_count);
|
||||||
_dcd_data.allocated_epin_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);
|
dwc2_regs_t* dwc2 = DWC2_REG(rhport);
|
||||||
uint8_t const ep_count = _dwc2_controller[rhport].ep_count;
|
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
|
// Disable non-control interrupt
|
||||||
dwc2->daintmsk = (1 << DAINTMSK_OEPM_Pos) | (1 << DAINTMSK_IEPM_Pos);
|
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));
|
tu_memclr(xfer_status, sizeof(xfer_status));
|
||||||
|
|
||||||
_dcd_data.sof_en = false;
|
_dcd_data.sof_en = false;
|
||||||
_dcd_data.allocated_epin_count = 1;
|
_dcd_data.allocated_epin_count = 0;
|
||||||
|
|
||||||
// 1. NAK for all OUT endpoints
|
// 1. NAK for all OUT endpoints
|
||||||
for (uint8_t n = 0; n < ep_count; n++) {
|
for (uint8_t n = 0; n < ep_count; n++) {
|
||||||
|
Reference in New Issue
Block a user