diff options
| author | hathach <[email protected]> | 2023-07-21 19:06:36 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2023-07-21 19:06:36 +0700 |
| commit | c122e9df73331fa60d1713c7cc4cf46251b0cd76 (patch) | |
| tree | 00f4a6245e6357672cb42ab4ba0cf33c2892418e /src/host/usbh.c | |
| parent | 14c98dd863a9cab55fc2981fb826f63eceed4b2d (diff) | |
implement hcd_edpt_abort_xfer() for EHCI, also move thing around a bit
Diffstat (limited to 'src/host/usbh.c')
| -rw-r--r-- | src/host/usbh.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/host/usbh.c b/src/host/usbh.c index bbf333d5f..15c48be47 100644 --- a/src/host/usbh.c +++ b/src/host/usbh.c @@ -718,9 +718,15 @@ bool tuh_edpt_abort_xfer(uint8_t daddr, uint8_t ep_addr) { uint8_t const dir = tu_edpt_dir(ep_addr); // skip if not busy - if (!dev->ep_status[epnum][dir].busy) return true; + TU_VERIFY(dev->ep_status[epnum][dir].busy); - return hcd_edpt_abort_xfer(dev->rhport, daddr, ep_addr); + bool const ret = hcd_edpt_abort_xfer(dev->rhport, daddr, ep_addr); + if (ret) { + // mark as ready if transfer is aborted + dev->ep_status[epnum][dir].busy = false; + } + + return ret; } //--------------------------------------------------------------------+ |
