summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsumengqi <[email protected]>2025-05-11 09:09:06 +0800
committerGitHub <[email protected]>2025-05-11 09:09:06 +0800
commit4d3770b5d0ca5291941e95b64b68e804b0265b30 (patch)
treee662863d0a6172581ca2c410aec11f3e4bab3b60
parent336aa91d24643140e1fed01112d6a80962dd2496 (diff)
fix:(port/ch32/usb_dc_usbhs.c) fix isochronous in endpoint config bug (#314)
* fix:(port/ch32/usb_dc_usbhs.c) fix isochronous in endpoint config bug
-rw-r--r--port/ch32/usb_dc_usbhs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/port/ch32/usb_dc_usbhs.c b/port/ch32/usb_dc_usbhs.c
index f2b8caa3..bc9efb9b 100644
--- a/port/ch32/usb_dc_usbhs.c
+++ b/port/ch32/usb_dc_usbhs.c
@@ -123,11 +123,12 @@ int usbd_ep_open(uint8_t busid, const struct usb_endpoint_descriptor *ep)
g_ch32_usbhs_udc.in_ep[ep_idx].ep_enable = true;
if (g_ch32_usbhs_udc.in_ep[ep_idx].ep_type == USB_ENDPOINT_TYPE_ISOCHRONOUS) {
USBHS_DEVICE->ENDP_TYPE |= (1 << (ep_idx));
+ USB_SET_TX_CTRL(ep_idx, USBHS_EP_T_RES_NAK | USBHS_EP_T_TOG_0);
} else {
USBHS_DEVICE->ENDP_TYPE &= ~(1 << (ep_idx));
+ USB_SET_TX_CTRL(ep_idx, USBHS_EP_T_RES_NAK | USBHS_EP_T_TOG_0 | USBHS_EP_T_AUTOTOG);
}
USBHS_DEVICE->ENDP_CONFIG |= (1 << (ep_idx));
- USB_SET_TX_CTRL(ep_idx, USBHS_EP_T_RES_NAK | USBHS_EP_T_TOG_0 | USBHS_EP_T_AUTOTOG);
}
USB_SET_MAX_LEN(ep_idx, USB_GET_MAXPACKETSIZE(ep->wMaxPacketSize));
return 0;