summaryrefslogtreecommitdiff
path: root/src/device
diff options
context:
space:
mode:
authorhathach <[email protected]>2021-08-12 15:46:33 +0700
committerhathach <[email protected]>2021-08-12 15:54:04 +0700
commit17ef9f4843250e8c6b6b1fde53ed6a54a4f20470 (patch)
treec8d3c4fe68627598c39bfc528289611f2d3fd02e /src/device
parent4ad47d9e264a7119f5429a045a185ad0d448d998 (diff)
add ready check for edpt claim
Diffstat (limited to 'src/device')
-rw-r--r--src/device/usbd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/device/usbd.c b/src/device/usbd.c
index a30eab217..bef7725b5 100644
--- a/src/device/usbd.c
+++ b/src/device/usbd.c
@@ -1191,6 +1191,8 @@ bool usbd_edpt_claim(uint8_t rhport, uint8_t ep_addr)
{
(void) rhport;
+ TU_VERIFY(tud_ready());
+
uint8_t const epnum = tu_edpt_number(ep_addr);
uint8_t const dir = tu_edpt_dir(ep_addr);
@@ -1244,6 +1246,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 !