summaryrefslogtreecommitdiff
path: root/examples/device/cdc_msc_freertos/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/device/cdc_msc_freertos/src/main.c')
-rw-r--r--examples/device/cdc_msc_freertos/src/main.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/examples/device/cdc_msc_freertos/src/main.c b/examples/device/cdc_msc_freertos/src/main.c
index 1371b84c3..e90c3f0d9 100644
--- a/examples/device/cdc_msc_freertos/src/main.c
+++ b/examples/device/cdc_msc_freertos/src/main.c
@@ -168,9 +168,11 @@ void cdc_task(void* params)
// RTOS forever loop
while ( 1 )
{
- 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
+ // There are data available
if ( tud_cdc_available() )
{
uint8_t buf[64];
@@ -198,12 +200,14 @@ void cdc_task(void* params)
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 with FreeRTOS example\r\n");
+ tud_cdc_write_flush();
}
}