diff options
| author | Ha Thach <[email protected]> | 2021-01-21 16:35:13 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-01-21 16:35:13 +0700 |
| commit | 1e134cbb31cb0fcd593d47e9865dd2c4dba68686 (patch) | |
| tree | 4638eb5eb885e89be071a83a9297ad9da126cdf8 /examples/device/cdc_msc/src/main.c | |
| parent | e0aa405d19e35dbf58cf502b8106455c1a3c2a5c (diff) | |
| parent | 7aaccd94d2e11ee2329353b4119526c75279b3ba (diff) | |
Merge branch 'master' into pico
Diffstat (limited to 'examples/device/cdc_msc/src/main.c')
| -rw-r--r-- | examples/device/cdc_msc/src/main.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/examples/device/cdc_msc/src/main.c b/examples/device/cdc_msc/src/main.c index a407e2ddd..a20a80fcd 100644 --- a/examples/device/cdc_msc/src/main.c +++ b/examples/device/cdc_msc/src/main.c @@ -105,7 +105,9 @@ void tud_resume_cb(void) //--------------------------------------------------------------------+ void cdc_task(void) { - if ( tud_cdc_connected() ) + // connected() check for DTR bit + // Most but not all terminal client set this when making connection + // if ( tud_cdc_connected() ) { // connected and there are data available if ( tud_cdc_available() ) @@ -131,12 +133,14 @@ void cdc_task(void) void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts) { (void) itf; + (void) rts; // connected - if ( dtr && rts ) + if ( dtr ) { // print initial message when connected tud_cdc_write_str("\r\nTinyUSB CDC MSC device example\r\n"); + tud_cdc_write_flush(); } } |
