summaryrefslogtreecommitdiff
path: root/src/class
diff options
context:
space:
mode:
authorhathach <[email protected]>2020-09-09 16:29:45 +0700
committerhathach <[email protected]>2020-09-09 16:29:45 +0700
commitfe1b5dfa235550cc4eb63e237da50689fe407bf4 (patch)
tree6d22ba80eced2b8c60ce8738f1e46b785eae9096 /src/class
parent33f0a18523accfcdebf186f33271dd92f8681b56 (diff)
clean up
Diffstat (limited to 'src/class')
-rw-r--r--src/class/cdc/cdc_device.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/class/cdc/cdc_device.c b/src/class/cdc/cdc_device.c
index 317355ed7..8ea44b28d 100644
--- a/src/class/cdc/cdc_device.c
+++ b/src/class/cdc/cdc_device.c
@@ -164,11 +164,10 @@ uint32_t tud_cdc_n_write_flush (uint8_t itf)
uint8_t const rhport = TUD_OPT_RHPORT;
- // claim the endpoint first
- TU_VERIFY( usbd_edpt_claim(rhport, p_cdc->ep_in), 0 );
+ // Claim the endpoint first
+ TU_VnERIFY( usbd_edpt_claim(rhport, p_cdc->ep_in), 0 );
- // we can be blocked by another write()/write_flush() from other thread.
- // causing us to attempt to transfer on an busy endpoint.
+ // Pull data from FIFO
uint16_t const count = tu_fifo_read_n(&p_cdc->tx_ff, p_cdc->epin_buf, sizeof(p_cdc->epin_buf));
if ( count && tud_cdc_n_connected(itf) )