mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-17 05:32:55 +08:00
Turn transmit fifo overwritable in no DTR mode
This commit is contained in:
parent
d9eaa54e14
commit
fd6cf9010b
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user