support pio dcd endpiont stall

This commit is contained in:
hathach
2022-04-16 01:19:51 +07:00
parent 00a0e3f21b
commit b5a9537eea
2 changed files with 6 additions and 3 deletions

View File

@@ -136,14 +136,17 @@ bool dcd_edpt_xfer (uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t
void dcd_edpt_stall (uint8_t rhport, uint8_t ep_addr)
{
(void) rhport;
(void) ep_addr;
pio_hw_endpoint_t *ep = pio_usb_device_get_ep(ep_addr);
ep->stalled = true;
}
// clear stall, data toggle is also reset to DATA0
void dcd_edpt_clear_stall (uint8_t rhport, uint8_t ep_addr)
{
(void) rhport;
(void) ep_addr;
pio_hw_endpoint_t *ep = pio_usb_device_get_ep(ep_addr);
ep->data_id = 0;
ep->stalled = false;
}
//--------------------------------------------------------------------+