diff options
| author | Gavin Li <[email protected]> | 2020-06-20 22:12:10 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-06-20 22:12:10 -0700 |
| commit | 7ae47a93979071ec3c7724c35f1ef55572ad1a1f (patch) | |
| tree | 34d5d02b565b708c89405c6e1846a8261c12a9cd /src | |
| parent | 8fe887198b63520c23af9f4c27d9733f6bb18e90 (diff) | |
Call tud_cdc_tx_cb right after flush to keep tx fifo full
Diffstat (limited to 'src')
| -rw-r--r-- | src/class/cdc/cdc_device.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/class/cdc/cdc_device.c b/src/class/cdc/cdc_device.c index b979b11f1..d8be48688 100644 --- a/src/class/cdc/cdc_device.c +++ b/src/class/cdc/cdc_device.c @@ -416,9 +416,6 @@ 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_cb && !tu_fifo_full(&p_cdc->tx_ff) ) tud_cdc_tx_cb(itf); - if ( 0 == tud_cdc_n_write_flush(itf) ) { // There is no data left, a ZLP should be sent if @@ -428,6 +425,9 @@ bool cdcd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_ usbd_edpt_xfer(TUD_OPT_RHPORT, p_cdc->ep_in, NULL, 0); } } + + // invoke transmit callback to possibly refill tx fifo + if ( tud_cdc_tx_cb && !tu_fifo_full(&p_cdc->tx_ff) ) tud_cdc_tx_cb(itf); } // nothing to do with notif endpoint for now |
