mirror of
https://github.com/hathach/tinyusb.git
synced 2025-04-24 18:02:40 +00:00
clean up
This commit is contained in:
parent
33f0a18523
commit
fe1b5dfa23
@ -164,11 +164,10 @@ uint32_t tud_cdc_n_write_flush (uint8_t itf)
|
|||||||
|
|
||||||
uint8_t const rhport = TUD_OPT_RHPORT;
|
uint8_t const rhport = TUD_OPT_RHPORT;
|
||||||
|
|
||||||
// claim the endpoint first
|
// Claim the endpoint first
|
||||||
TU_VERIFY( usbd_edpt_claim(rhport, p_cdc->ep_in), 0 );
|
TU_VnERIFY( usbd_edpt_claim(rhport, p_cdc->ep_in), 0 );
|
||||||
|
|
||||||
// we can be blocked by another write()/write_flush() from other thread.
|
// Pull data from FIFO
|
||||||
// causing us to attempt to transfer on an busy endpoint.
|
|
||||||
uint16_t const count = tu_fifo_read_n(&p_cdc->tx_ff, p_cdc->epin_buf, sizeof(p_cdc->epin_buf));
|
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) )
|
if ( count && tud_cdc_n_connected(itf) )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user