Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cores/arduino/USBCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,11 @@ class ClassCore
} else if (sent < 0) {
return REQ_NOTSUPP;
}
} else if ((setup.bmRequestType & USB_RECPTYPE_MASK) == USB_RECPTYPE_EP) {
uint8_t ep = EP_ID(setup.wIndex);
// Reset endpoint state on ClearFeature(EndpointHalt)
EPBuffers().buf(ep).init(ep);
return REQ_SUPP;
} else {
#ifdef USBD_USE_CDC
if (CDCACM().setup(setup))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,15 +412,15 @@ static void usbd_ep_stall_clear (usb_dev *udev, uint8_t ep_addr)
udev->transc_in[ep_num].ep_stall = 0U;

/* clear endpoint stall status */
USBD_EP_TX_STAT_SET(ep_num, EPTX_VALID);
USBD_EP_TX_STAT_SET(ep_num, EPTX_NAK);
} else {
/* clear endpoint data toggle bit */
USBD_RX_DTG_CLEAR(ep_num);

udev->transc_out[ep_num].ep_stall = 0U;

/* clear endpoint stall status */
USBD_EP_RX_STAT_SET(ep_num, EPRX_VALID);
USBD_EP_RX_STAT_SET(ep_num, EPRX_NAK);
}
}

Expand Down