diff options
| author | hathach <[email protected]> | 2018-07-14 23:43:19 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-07-14 23:43:19 +0700 |
| commit | abb37e98baa16ae9f99f9d7562e4ee166e8bc4de (patch) | |
| tree | 865b77a3d3472d0aa085b7d8e7ff5aa59e8a2f36 /src/class/cdc/cdc_device.c | |
| parent | 19b6bbfd14778c5a1fd13d2c0665dfbaa49c9425 (diff) | |
rename tud_cdc_flush() to tud_cdc_write_flush(), add tud_cdc_read_flush()
Diffstat (limited to 'src/class/cdc/cdc_device.c')
| -rw-r--r-- | src/class/cdc/cdc_device.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/class/cdc/cdc_device.c b/src/class/cdc/cdc_device.c index 04402c5bb..bcef47136 100644 --- a/src/class/cdc/cdc_device.c +++ b/src/class/cdc/cdc_device.c @@ -136,6 +136,11 @@ char tud_cdc_n_peek(uint8_t itf, int pos) return tu_fifo_peek_at(&_cdcd_itf[itf].intact.rx_ff, pos, &ch) ? ch : (-1);
}
+void tud_cdc_n_read_flush (uint8_t itf)
+{
+ tu_fifo_clear(&_cdcd_itf[itf].intact.rx_ff);
+}
+
//--------------------------------------------------------------------+
// WRITE API
//--------------------------------------------------------------------+
@@ -150,7 +155,7 @@ uint32_t tud_cdc_n_write(uint8_t itf, void const* buffer, uint32_t bufsize) return tu_fifo_write_n(&_cdcd_itf[itf].intact.tx_ff, buffer, bufsize);
}
-bool tud_cdc_n_flush (uint8_t itf)
+bool tud_cdc_n_write_flush (uint8_t itf)
{
uint8_t edpt = _cdcd_itf[itf].ep_in;
VERIFY( !dcd_edpt_busy(TUD_RHPORT, edpt) ); // skip if previous transfer not complete
|
