diff options
| author | Ha Thach <[email protected]> | 2021-08-18 16:45:35 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-08-18 16:45:35 +0700 |
| commit | 830757d9ce98e646ef5941f35e3f5c9ecc2e3f13 (patch) | |
| tree | 1bf0c0ca0e07d9565d1014a662e0c4c5489a2a23 /src/device | |
| parent | 0411810bc0ae3b9dce84d4852506706d72a29d93 (diff) | |
| parent | d52b981c3af06233891e827edcd484ece244a5a8 (diff) | |
Merge pull request #1020 from hathach/rp2040-disconnect-suspend
Add Rp2040 suspend & resume support
Diffstat (limited to 'src/device')
| -rw-r--r-- | src/device/dcd.h | 1 | ||||
| -rw-r--r-- | src/device/usbd.c | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/device/dcd.h b/src/device/dcd.h index 8bfad9b72..66767c1fe 100644 --- a/src/device/dcd.h +++ b/src/device/dcd.h @@ -152,6 +152,7 @@ bool dcd_edpt_xfer_fifo (uint8_t rhport, uint8_t ep_addr, tu_fifo_t * ff, void dcd_edpt_stall (uint8_t rhport, uint8_t ep_addr); // clear stall, data toggle is also reset to DATA0 +// This API never calls with control endpoints, since it is auto cleared when receiving setup packet void dcd_edpt_clear_stall (uint8_t rhport, uint8_t ep_addr); //--------------------------------------------------------------------+ diff --git a/src/device/usbd.c b/src/device/usbd.c index e8a50352c..8b4f4e7e3 100644 --- a/src/device/usbd.c +++ b/src/device/usbd.c @@ -1220,6 +1220,9 @@ bool usbd_edpt_claim(uint8_t rhport, uint8_t ep_addr) { (void) rhport; + // TODO add this check later, also make sure we don't starve an out endpoint while suspending + // TU_VERIFY(tud_ready()); + uint8_t const epnum = tu_edpt_number(ep_addr); uint8_t const dir = tu_edpt_dir(ep_addr); @@ -1273,6 +1276,9 @@ bool usbd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t uint8_t const epnum = tu_edpt_number(ep_addr); uint8_t const dir = tu_edpt_dir(ep_addr); + // TODO skip ready() check for now since enumeration also use this API + // TU_VERIFY(tud_ready()); + TU_LOG2(" Queue EP %02X with %u bytes ...\r\n", ep_addr, total_bytes); // Attempt to transfer on a busy endpoint, sound like an race condition ! |
