Skip to content

Commit

Permalink
handle clearing endpoint stall
Browse files Browse the repository at this point in the history
Re-init the endpoint buffer state on ClearFeature(EndpointHalt).
  • Loading branch information
tlyu committed Nov 23, 2022
1 parent ac14728 commit 02a1544
Showing 1 changed file with 5 additions and 0 deletions.
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

0 comments on commit 02a1544

Please sign in to comment.