add tud_ready() check in tud_cdc_n_write_flush()

other clean up
This commit is contained in:
hathach
2020-11-23 23:40:13 +07:00
parent 308028e17c
commit 4b4f880785
4 changed files with 15 additions and 18 deletions

View File

@@ -145,16 +145,6 @@ void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts)
void tud_cdc_rx_cb(uint8_t itf)
{
(void) itf;
uint8_t const line_state = tud_cdc_get_line_state();
// Provide information that terminal did not set DTR bit
if( !(line_state & 0x01) )
{
tud_cdc_write_str("\r\nTinyUSB example: Your terminal did not set DTR bit\r\n");
tud_cdc_write_flush();
// Clear rx fifo since we do not read the data
tud_cdc_read_flush();
}
}
//--------------------------------------------------------------------+