edpt_close: Updated based on feedback.

This commit is contained in:
Nathan Conrad
2020-04-13 09:25:16 -04:00
parent 0eeaccaf46
commit f8e7487355
5 changed files with 52 additions and 28 deletions

View File

@@ -1044,6 +1044,8 @@ bool usbd_edpt_stalled(uint8_t rhport, uint8_t ep_addr)
/**
* Remove queued xfer complete messages from event queue,
* for a particular ep.
*
* Must be called with interrupts enabled.
*/
static void usbd_abort_transfers(uint8_t rhport, uint8_t ep_addr)
{
@@ -1077,13 +1079,13 @@ static void usbd_abort_transfers(uint8_t rhport, uint8_t ep_addr)
}
/**
* tud_edpt_close will disable an endpoint, and clear all pending transfers
* usbd_edpt_close will disable an endpoint, and clear all pending transfers
* through the particular endpoint.
*
* It must be called from the usb task (i.e. from the control request
* handler while handling SET_ALTERNATE).
* It must be called from the usb task (e.g. from the control request
* handler while handling SET_ALTERNATE), with interrupts enabled.
*/
void tud_edpt_close(uint8_t rhport, uint8_t ep_addr)
void usbd_edpt_close(uint8_t rhport, uint8_t ep_addr)
{
TU_ASSERT(dcd_edpt_close, /**/);

View File

@@ -79,8 +79,6 @@ static inline bool tud_connect(void)
return true;
}
void tud_edpt_close(uint8_t rhport, uint8_t ep_addr);
// Carry out Data and Status stage of control transfer
// - If len = 0, it is equivalent to sending status only
// - If len > wLength : it will be truncated

View File

@@ -38,6 +38,7 @@
//--------------------------------------------------------------------+
//bool usbd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const * p_endpoint_desc);
void usbd_edpt_close(uint8_t rhport, uint8_t ep_addr);
// Submit a usb transfer
bool usbd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes);