summaryrefslogtreecommitdiff
path: root/examples/device
diff options
context:
space:
mode:
Diffstat (limited to 'examples/device')
-rw-r--r--examples/device/cdc_msc_hid/src/main.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/examples/device/cdc_msc_hid/src/main.c b/examples/device/cdc_msc_hid/src/main.c
index d88bd3726..bc260fdfa 100644
--- a/examples/device/cdc_msc_hid/src/main.c
+++ b/examples/device/cdc_msc_hid/src/main.c
@@ -94,10 +94,19 @@ void virtual_com_task(void)
// read and echo back
uint32_t count = tud_cdc_read(buf, sizeof(buf));
- tud_cdc_write(buf, count);
- }
+ for(uint32_t i=0; i<count; i++)
+ {
+ tud_cdc_write_char(buf[i]);
- tud_cdc_write_flush();
+ if ( buf[i] == '\r' )
+ {
+ tud_cdc_write_char('\n');
+ tud_cdc_write_str("tinyusb cdc: ");
+ }
+ }
+
+ tud_cdc_write_flush();
+ }
}
}
@@ -109,7 +118,7 @@ void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts)
if ( dtr && rts )
{
// print greeting
- tud_cdc_write_str("tinyusb usb cdc\n");
+ tud_cdc_write_str("tinyusb cdc: ");
}
}
#endif