summaryrefslogtreecommitdiff
path: root/tinyusb/class/cdc/cdc_device.c
diff options
context:
space:
mode:
authorhathach <[email protected]>2018-04-07 15:04:01 +0700
committerhathach <[email protected]>2018-04-07 15:04:01 +0700
commitfb27ae96b0197d4f072d3e5b825c8ef132903a96 (patch)
tree35782465cdd2a154a8126da2d0f539bda5b65892 /tinyusb/class/cdc/cdc_device.c
parent9be8e7bef6d8d8cada684f1f46334bceded7479f (diff)
fix cdc_device flush send zero bytes
Diffstat (limited to 'tinyusb/class/cdc/cdc_device.c')
-rw-r--r--tinyusb/class/cdc/cdc_device.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tinyusb/class/cdc/cdc_device.c b/tinyusb/class/cdc/cdc_device.c
index 4144dc018..f08f208ae 100644
--- a/tinyusb/class/cdc/cdc_device.c
+++ b/tinyusb/class/cdc/cdc_device.c
@@ -289,7 +289,11 @@ bool tud_n_cdc_flush (uint8_t rhport)
VERIFY( !dcd_edpt_busy(rhport, edpt) );
uint16_t count = fifo_read_n(&_tx_ff, _tmp_tx_buf, sizeof(_tmp_tx_buf));
- TU_ASSERT( dcd_edpt_xfer(rhport, edpt, _tmp_tx_buf, count) );
+
+ if ( count )
+ {
+ TU_ASSERT( dcd_edpt_xfer(rhport, edpt, _tmp_tx_buf, count) );
+ }
return true;
}