diff options
| author | sakumisu <[email protected]> | 2022-08-18 21:49:36 +0800 |
|---|---|---|
| committer | sakumisu <[email protected]> | 2022-08-18 21:49:36 +0800 |
| commit | 9e0cdf4cba4541a3206595a289c22c6fcd36dbc9 (patch) | |
| tree | fba2abaa35c5c01a5ea4809784c9f6c9d23df3c2 | |
| parent | 41239fa43fc28123a352a86677d7bfc4a09673a5 (diff) | |
fix pktcnt when read len is zero
| -rw-r--r-- | port/dwc2/usb_dc_dwc2.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/port/dwc2/usb_dc_dwc2.c b/port/dwc2/usb_dc_dwc2.c index d6b5e539..ae74a436 100644 --- a/port/dwc2/usb_dc_dwc2.c +++ b/port/dwc2/usb_dc_dwc2.c @@ -882,7 +882,7 @@ int usbd_ep_start_read(const uint8_t ep, uint8_t *data, uint32_t data_len) USB_OTG_OUTEP(ep_idx)->DOEPTSIZ &= ~(USB_OTG_DOEPTSIZ_PKTCNT); USB_OTG_OUTEP(ep_idx)->DOEPTSIZ &= ~(USB_OTG_DOEPTSIZ_XFRSIZ); if (data_len == 0) { - USB_OTG_OUTEP(ep_idx)->DOEPTSIZ |= (USB_OTG_DOEPTSIZ_PKTCNT & (pktcnt << 19)); + USB_OTG_OUTEP(ep_idx)->DOEPTSIZ |= (USB_OTG_DOEPTSIZ_PKTCNT & (1 << 19)); USB_OTG_OUTEP(ep_idx)->DOEPTSIZ |= (USB_OTG_DOEPTSIZ_XFRSIZ & g_dwc2_udc.out_ep[ep_idx].ep_mps); USB_OTG_OUTEP(ep_idx)->DOEPCTL |= (USB_OTG_DOEPCTL_CNAK | USB_OTG_DOEPCTL_EPENA); return 0; |
