diff options
| author | hathach <[email protected]> | 2021-08-31 17:39:54 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2021-08-31 17:39:54 +0700 |
| commit | d047b28aa262f253b758b82bc32fed55eb59d213 (patch) | |
| tree | 620ff469623d8b0cd4b8f14305613d23ab523558 /src/device/usbd.c | |
| parent | 76345ea3a1d78924585b8c4e0c5b5cb5e89d74e7 (diff) | |
remove set/clear busy flag in set/clear stall since they are different status
note: dcd should resume to prio-stalled queued transfer when unstall
Diffstat (limited to 'src/device/usbd.c')
| -rw-r--r-- | src/device/usbd.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/device/usbd.c b/src/device/usbd.c index 7cd8fad42..4f5a2f8ed 100644 --- a/src/device/usbd.c +++ b/src/device/usbd.c @@ -1214,12 +1214,12 @@ bool usbd_edpt_claim(uint8_t rhport, uint8_t ep_addr) #if CFG_TUSB_OS != OPT_OS_NONE // pre-check to help reducing mutex lock - TU_VERIFY((_usbd_dev.ep_status[epnum][dir].busy == 0) && (_usbd_dev.ep_status[epnum][dir].claimed == 0)); + TU_VERIFY( usbd_edpt_ready(rhport, ep_addr) && (_usbd_dev.ep_status[epnum][dir].claimed == 0)); osal_mutex_lock(_usbd_mutex, OSAL_TIMEOUT_WAIT_FOREVER); #endif // can only claim the endpoint if it is not busy and not claimed yet. - bool const ret = (_usbd_dev.ep_status[epnum][dir].busy == 0) && (_usbd_dev.ep_status[epnum][dir].claimed == 0); + bool const ret = usbd_edpt_ready(rhport, ep_addr) && (_usbd_dev.ep_status[epnum][dir].claimed == 0); if (ret) { _usbd_dev.ep_status[epnum][dir].claimed = 1; @@ -1340,7 +1340,6 @@ void usbd_edpt_stall(uint8_t rhport, uint8_t ep_addr) dcd_edpt_stall(rhport, ep_addr); _usbd_dev.ep_status[epnum][dir].stalled = true; - _usbd_dev.ep_status[epnum][dir].busy = true; } void usbd_edpt_clear_stall(uint8_t rhport, uint8_t ep_addr) @@ -1352,7 +1351,6 @@ void usbd_edpt_clear_stall(uint8_t rhport, uint8_t ep_addr) dcd_edpt_clear_stall(rhport, ep_addr); _usbd_dev.ep_status[epnum][dir].stalled = false; - _usbd_dev.ep_status[epnum][dir].busy = false; } bool usbd_edpt_stalled(uint8_t rhport, uint8_t ep_addr) |
