Skip to content

Commit fc7303d

Browse files
committed
fix(dcd_dwc2): Update assert comparison to allow open the last IN EP
1 parent ea4e59d commit fc7303d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/portable/synopsys/dwc2/dcd_dwc2.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ TU_ATTR_ALWAYS_INLINE static inline uint16_t calc_device_grxfsiz(uint16_t larges
174174
return 13 + 1 + 2 * ((largest_ep_size / 4) + 1) + 2 * ep_count;
175175
}
176176

177+
#include "esp_log.h"
178+
177179
static bool dfifo_alloc(uint8_t rhport, uint8_t ep_addr, uint16_t packet_size) {
178180
dwc2_regs_t* dwc2 = DWC2_REG(rhport);
179181
const dwc2_controller_t* dwc2_controller = &_dwc2_controller[rhport];
@@ -195,8 +197,9 @@ static bool dfifo_alloc(uint8_t rhport, uint8_t ep_addr, uint16_t packet_size) {
195197
}
196198
} else {
197199
// Check IN endpoints concurrently active limit
200+
ESP_EARLY_LOGW("dcd", "%d < %d?", _dcd_data.allocated_epin_count, _dwc2_controller->ep_in_count);
198201
if(_dwc2_controller->ep_in_count) {
199-
TU_ASSERT(_dcd_data.allocated_epin_count < _dwc2_controller->ep_in_count);
202+
TU_ASSERT(_dcd_data.allocated_epin_count <= _dwc2_controller->ep_in_count);
200203
_dcd_data.allocated_epin_count++;
201204
}
202205

0 commit comments

Comments
 (0)