summaryrefslogtreecommitdiff
path: root/src/class
diff options
context:
space:
mode:
authorGavin Li <[email protected]>2020-08-20 09:59:23 -0700
committerGitHub <[email protected]>2020-08-20 09:59:23 -0700
commit72183c7bb44ff117d9abac7b6e9c373c0945fb0b (patch)
treec9273dbc08995cbf51161e2c2c328b273727b1a3 /src/class
parent15b063beb287785b2bf84d00361000036afaba2c (diff)
Slight optimization for cdc tx refill
Diffstat (limited to 'src/class')
-rw-r--r--src/class/cdc/cdc_device.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/class/cdc/cdc_device.c b/src/class/cdc/cdc_device.c
index da9e94133..513fe203b 100644
--- a/src/class/cdc/cdc_device.c
+++ b/src/class/cdc/cdc_device.c
@@ -416,12 +416,10 @@ bool cdcd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_
// Though maybe the baudrate is not really important !!!
if ( ep_addr == p_cdc->ep_in )
{
- uint32_t flushed = tud_cdc_n_write_flush(itf);
-
// invoke transmit callback to possibly refill tx fifo
if ( tud_cdc_tx_complete_cb ) tud_cdc_tx_complete_cb(itf);
- if ( 0 == flushed && tu_fifo_empty(&p_cdc->tx_ff) )
+ if ( 0 == tud_cdc_n_write_flush(itf) )
{
// There is no data left, a ZLP should be sent if
// xferred_bytes is multiple of EP size and not zero