summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorhathach <[email protected]>2018-12-12 16:41:12 +0700
committerGitHub <[email protected]>2018-12-12 16:41:12 +0700
commit908931320e206e6ae6610cfc56b2a0950f252172 (patch)
tree8ae966733204841d54cf15f3e1154699cc884526 /examples
parentb7ad49332cd9a5539e35a75785adb5ca2e79715a (diff)
parent142f274c1d0cef2a1a5623885be29e2fecef4445 (diff)
Merge pull request #21 from hathach/devlocal
Devlocal
Diffstat (limited to 'examples')
-rw-r--r--examples/device/cdc_msc_hid/src/main.c17
-rw-r--r--examples/host/cdc_msc_hid/src/tusb_config.h2
2 files changed, 14 insertions, 5 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
diff --git a/examples/host/cdc_msc_hid/src/tusb_config.h b/examples/host/cdc_msc_hid/src/tusb_config.h
index 07764fa90..cc06ae93d 100644
--- a/examples/host/cdc_msc_hid/src/tusb_config.h
+++ b/examples/host/cdc_msc_hid/src/tusb_config.h
@@ -84,7 +84,7 @@
#define CFG_TUH_CDC 1
#define CFG_TUH_HID_KEYBOARD 0
#define CFG_TUH_HID_MOUSE 0
-#define CFG_TUSB_HOST_HID_GENERIC 0 // (not yet supported)
+#define CFG_TUSB_HOST_HID_GENERIC 0 // (not yet supported)
#define CFG_TUH_MSC 0
#define CFG_TUSB_HOST_DEVICE_MAX (CFG_TUH_HUB ? 5 : 1) // normal hub has 4 ports