We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 74e5749 + d01b2cf commit c773c61Copy full SHA for c773c61
src/class/cdc/cdc_device.c
@@ -295,7 +295,9 @@ void cdcd_reset(uint8_t rhport)
295
296
tu_memclr(p_cdc, ITF_MEM_RESET_SIZE);
297
tu_fifo_clear(&p_cdc->rx_ff);
298
+ #if !CFG_TUD_CDC_PERSISTENT_TX_BUFF
299
tu_fifo_clear(&p_cdc->tx_ff);
300
+ #endif
301
tu_fifo_set_overwritable(&p_cdc->tx_ff, true);
302
}
303
src/class/cdc/cdc_device.h
@@ -41,6 +41,12 @@
41
#define CFG_TUD_CDC_EP_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
42
#endif
43
44
+// By default the TX fifo buffer is cleared on connect / bus reset.
45
+// Enable this to persist any data in the fifo instead.
46
+#ifndef CFG_TUD_CDC_PERSISTENT_TX_BUFF
47
+ #define CFG_TUD_CDC_PERSISTENT_TX_BUFF (0)
48
+#endif
49
+
50
#ifdef __cplusplus
51
extern "C" {
52
0 commit comments