diff options
| author | sakumisu <[email protected]> | 2025-04-23 18:21:31 +0800 |
|---|---|---|
| committer | sakumisu <[email protected]> | 2025-04-23 18:21:31 +0800 |
| commit | 894b80d9edbf8738cf81f3893c20194229afe63a (patch) | |
| tree | 6bb3035b27c55c7d821e99849b842ead03fa4599 | |
| parent | 4c8d448ca2b5156d5d80a72d095e21196e5fa779 (diff) | |
fix(port/dwc2/usb_hc_dwc2): enlarge pktcnt to 0x3ff, GHWCFG3(bit4:6) = 6, GHWCFG3(bit0:3) = 8
Signed-off-by: sakumisu <[email protected]>
| -rw-r--r-- | port/dwc2/usb_hc_dwc2.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/port/dwc2/usb_hc_dwc2.c b/port/dwc2/usb_hc_dwc2.c index eb8745e7..9ffb7cb7 100644 --- a/port/dwc2/usb_hc_dwc2.c +++ b/port/dwc2/usb_hc_dwc2.c @@ -378,14 +378,14 @@ static void dwc2_chan_free(struct dwc2_chan *chan) usb_osal_leave_critical_section(flags); } -static uint8_t dwc2_calculate_packet_num(uint32_t input_size, uint8_t ep_addr, uint16_t ep_mps, uint32_t *output_size) +static uint16_t dwc2_calculate_packet_num(uint32_t input_size, uint8_t ep_addr, uint16_t ep_mps, uint32_t *output_size) { uint16_t num_packets; num_packets = (uint16_t)((input_size + ep_mps - 1U) / ep_mps); - if (num_packets > 256) { - num_packets = 256; + if (num_packets > 0x3FF) { + num_packets = 0x3FF; // pktcnt 10bits } if (input_size == 0) { |
