diff options
| author | Wini-Buh <[email protected]> | 2021-06-11 22:36:17 +0200 |
|---|---|---|
| committer | Wini-Buh <[email protected]> | 2021-06-11 22:36:17 +0200 |
| commit | 60d8ecbfe617b0f398f90c3fede9a9488f4da407 (patch) | |
| tree | 30484f43a2e94b8bd6ce6301377a32036950f625 /src/device | |
| parent | 1c23462b43f47685cf0051568f4bfea5de37d563 (diff) | |
| parent | b34724215bea28ef93fd80ed9c2e4ddc87874093 (diff) | |
clean up
Diffstat (limited to 'src/device')
| -rw-r--r-- | src/device/dcd.h | 12 | ||||
| -rw-r--r-- | src/device/usbd.c | 4 | ||||
| -rw-r--r-- | src/device/usbd_pvt.h | 2 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/device/dcd.h b/src/device/dcd.h index 25cfafc4b..63e97df96 100644 --- a/src/device/dcd.h +++ b/src/device/dcd.h @@ -121,20 +121,20 @@ void dcd_disconnect(uint8_t rhport) TU_ATTR_WEAK; // May help DCD to prepare for next control transfer, this API is optional. void dcd_edpt0_status_complete(uint8_t rhport, tusb_control_request_t const * request) TU_ATTR_WEAK; +// Configure endpoint's registers according to descriptor +bool dcd_edpt_open (uint8_t rhport, tusb_desc_endpoint_t const * desc_ep); + // Close an endpoint. // Since it is weak, caller must TU_ASSERT this function's existence before calling it. void dcd_edpt_close (uint8_t rhport, uint8_t ep_addr) TU_ATTR_WEAK; +// Submit a transfer, When complete dcd_event_xfer_complete() is invoked to notify the stack +bool dcd_edpt_xfer (uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes); + // Submit an transfer using fifo, When complete dcd_event_xfer_complete() is invoked to notify the stack // This API is optional, may be useful for register-based for transferring data. bool dcd_edpt_xfer_fifo (uint8_t rhport, uint8_t ep_addr, tu_fifo_t * ff, uint16_t total_bytes) TU_ATTR_WEAK; -// Configure endpoint's registers according to descriptor -bool dcd_edpt_open (uint8_t rhport, tusb_desc_endpoint_t const * p_endpoint_desc); - -// Submit a transfer, When complete dcd_event_xfer_complete() is invoked to notify the stack -bool dcd_edpt_xfer (uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes); - // Stall endpoint void dcd_edpt_stall (uint8_t rhport, uint8_t ep_addr); diff --git a/src/device/usbd.c b/src/device/usbd.c index 49c9279bf..cedca540e 100644 --- a/src/device/usbd.c +++ b/src/device/usbd.c @@ -1254,8 +1254,8 @@ bool usbd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t // Attempt to transfer on a busy endpoint, sound like an race condition ! TU_ASSERT(_usbd_dev.ep_status[epnum][dir].busy == 0); - // Set busy first since the actual transfer can be complete before dcd_edpt_xfer() could return - // and usbd task can preempt and clear the busy + // Set busy first since the actual transfer can be complete before dcd_edpt_xfer() + // could return and USBD task can preempt and clear the busy _usbd_dev.ep_status[epnum][dir].busy = true; if ( dcd_edpt_xfer(rhport, ep_addr, buffer, total_bytes) ) diff --git a/src/device/usbd_pvt.h b/src/device/usbd_pvt.h index bb2267d40..6a4b30956 100644 --- a/src/device/usbd_pvt.h +++ b/src/device/usbd_pvt.h @@ -34,7 +34,7 @@ #endif //--------------------------------------------------------------------+ -// Class Drivers +// Class Driver API //--------------------------------------------------------------------+ typedef struct |
