summaryrefslogtreecommitdiff
path: root/src/class/cdc/cdc_device.c
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2020-08-21 11:14:06 +0700
committerGitHub <[email protected]>2020-08-21 11:14:06 +0700
commite5d622b749593d5bab893a8d6a826b1d384677ac (patch)
tree7e93890839e0db93b791d521736b66279510f4c3 /src/class/cdc/cdc_device.c
parente90cf7a676eddcbd9c35d2d99a0a9cd14686e2ce (diff)
parent72183c7bb44ff117d9abac7b6e9c373c0945fb0b (diff)
Merge pull request #434 from gh2o/master
Add TX callback to CDC device
Diffstat (limited to 'src/class/cdc/cdc_device.c')
-rw-r--r--src/class/cdc/cdc_device.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/class/cdc/cdc_device.c b/src/class/cdc/cdc_device.c
index 89326f71d..94473d036 100644
--- a/src/class/cdc/cdc_device.c
+++ b/src/class/cdc/cdc_device.c
@@ -416,6 +416,9 @@ 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 )
{
+ // invoke transmit callback to possibly refill tx fifo
+ if ( tud_cdc_tx_complete_cb ) tud_cdc_tx_complete_cb(itf);
+
if ( 0 == tud_cdc_n_write_flush(itf) )
{
// There is no data left, a ZLP should be sent if