summaryrefslogtreecommitdiff
path: root/src/device
diff options
context:
space:
mode:
authorNathan Conrad <[email protected]>2020-04-13 11:05:34 -0400
committerNathan Conrad <[email protected]>2020-04-13 11:05:34 -0400
commitde208b31cf648c03670f34ff615a0f7ac6b566f3 (patch)
tree2bfe94bce7758ecf0a47f381be0424b27b2cff3d /src/device
parentf8e7487355c1d48517211a2316fbbc8566a1532d (diff)
edpt_close: Remove item from queue instead of modifying it.
Diffstat (limited to 'src/device')
-rw-r--r--src/device/dcd.h2
-rw-r--r--src/device/usbd.c12
2 files changed, 5 insertions, 9 deletions
diff --git a/src/device/dcd.h b/src/device/dcd.h
index f48530227..99e623358 100644
--- a/src/device/dcd.h
+++ b/src/device/dcd.h
@@ -66,7 +66,7 @@ typedef struct TU_ATTR_ALIGNED(4)
// USBD_EVT_XFER_COMPLETE
struct {
- uint8_t ep_addr; ///< 0xFF signifies that the transfer was aborted.
+ uint8_t ep_addr;
uint8_t result;
uint32_t len;
}xfer_complete;
diff --git a/src/device/usbd.c b/src/device/usbd.c
index 71f5454ee..386401d9a 100644
--- a/src/device/usbd.c
+++ b/src/device/usbd.c
@@ -420,11 +420,6 @@ void tud_task (void)
uint8_t const ep_addr = event.xfer_complete.ep_addr;
uint8_t const epnum = tu_edpt_number(ep_addr);
uint8_t const ep_dir = tu_edpt_dir(ep_addr);
-
- if(ep_addr == 0xFF) // aborted transfer
- {
- break;
- }
TU_LOG2(" Endpoint: 0x%02X, Bytes: %u\r\n", ep_addr, (unsigned int) event.xfer_complete.len);
@@ -1069,9 +1064,11 @@ static void usbd_abort_transfers(uint8_t rhport, uint8_t ep_addr)
&& (event.xfer_complete.ep_addr == ep_addr))
{
_usbd_dev.ep_status[epnum][ep_dir].busy = false;
- event.xfer_complete.ep_addr = 0xFF; // Mark transfer as invalid
}
- TU_ASSERT(osal_queue_send(_usbd_q, &event, true), /**/);
+ else
+ {
+ TU_ASSERT(osal_queue_send(_usbd_q, &event, true), /**/);
+ }
TU_ASSERT(osal_queue_receive(_usbd_q, &event), /**/);
}
@@ -1087,7 +1084,6 @@ static void usbd_abort_transfers(uint8_t rhport, uint8_t ep_addr)
*/
void usbd_edpt_close(uint8_t rhport, uint8_t ep_addr)
{
-
TU_ASSERT(dcd_edpt_close, /**/);
TU_LOG2(" CLOSING Endpoint: 0x%02X\r\n", ep_addr);