summaryrefslogtreecommitdiff
path: root/src/class/cdc
diff options
context:
space:
mode:
authorJan Dümpelmann <[email protected]>2020-09-03 17:03:13 +0200
committerJan Dümpelmann <[email protected]>2020-09-03 17:03:13 +0200
commitfd6cf9010b522019a4434ebd02fb447b567e7131 (patch)
treef24d8e9718a72d3684499d7c9fc3f52104f4c969 /src/class/cdc
parentd9eaa54e14775ebcf6a78cb84c354e69e57903d3 (diff)
Turn transmit fifo overwritable in no DTR mode
Diffstat (limited to 'src/class/cdc')
-rw-r--r--src/class/cdc/cdc_device.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/class/cdc/cdc_device.c b/src/class/cdc/cdc_device.c
index 91799b2de..6c0f5fc7a 100644
--- a/src/class/cdc/cdc_device.c
+++ b/src/class/cdc/cdc_device.c
@@ -197,7 +197,7 @@ void cdcd_init(void)
// config fifo
tu_fifo_config(&p_cdc->rx_ff, p_cdc->rx_ff_buf, TU_ARRAY_SIZE(p_cdc->rx_ff_buf), 1, false);
- tu_fifo_config(&p_cdc->tx_ff, p_cdc->tx_ff_buf, TU_ARRAY_SIZE(p_cdc->tx_ff_buf), 1, false);
+ tu_fifo_config(&p_cdc->tx_ff, p_cdc->tx_ff_buf, TU_ARRAY_SIZE(p_cdc->tx_ff_buf), 1, true);
#if CFG_FIFO_MUTEX
tu_fifo_config_mutex(&p_cdc->rx_ff, osal_mutex_create(&p_cdc->rx_ff_mutex));
@@ -355,6 +355,9 @@ bool cdcd_control_request(uint8_t rhport, tusb_control_request_t const * request
p_cdc->line_state = (uint8_t) request->wValue;
+ // Disable fifo overwriting if DTR bit is set
+ p_cdc->tx_ff.overwritable = dtr ? false : true;
+
TU_LOG2(" Set Control Line State: DTR = %d, RTS = %d\r\n", dtr, rts);
tud_control_status(rhport, request);