summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorhathach <[email protected]>2018-12-06 00:38:00 +0700
committerhathach <[email protected]>2018-12-06 00:38:00 +0700
commit5f7d7a34f576dabd94c10fad05fe5fa85d4ef1e0 (patch)
tree0381299d6045b0867c8b5a9fd345c0150ef0e3f8 /examples
parent5d4d3431c20f983d6acf913dd0bd659eb5222e50 (diff)
able to complete enumeration with os none blocking
Diffstat (limited to 'examples')
-rw-r--r--examples/host/cdc_msc_hid/src/main.c23
-rw-r--r--examples/host/cdc_msc_hid/src/tusb_config.h2
2 files changed, 22 insertions, 3 deletions
diff --git a/examples/host/cdc_msc_hid/src/main.c b/examples/host/cdc_msc_hid/src/main.c
index 2459ec329..c888f7bf7 100644
--- a/examples/host/cdc_msc_hid/src/main.c
+++ b/examples/host/cdc_msc_hid/src/main.c
@@ -66,7 +66,7 @@ int main(void)
led_blinking_task();
-#if CFG_TUD_CDC
+#if CFG_TUSB_HOST_CDC
virtual_com_task();
#endif
@@ -81,7 +81,26 @@ int main(void)
//--------------------------------------------------------------------+
// USB CDC
//--------------------------------------------------------------------+
-#if CFG_TUD_CDC
+#if CFG_TUSB_HOST_CDC
+
+void tuh_cdc_mounted_cb(uint8_t dev_addr)
+{
+ // application set-up
+ printf("\na CDC device (address %d) is mounted\n", dev_addr);
+}
+
+void tuh_cdc_unmounted_cb(uint8_t dev_addr)
+{
+ // application tear-down
+ printf("\na CDC device (address %d) is unmounted \n", dev_addr);
+}
+
+// invoked ISR context
+void tuh_cdc_xfer_isr(uint8_t dev_addr, xfer_result_t event, cdc_pipeid_t pipe_id, uint32_t xferred_bytes)
+{
+
+}
+
void virtual_com_task(void)
{
diff --git a/examples/host/cdc_msc_hid/src/tusb_config.h b/examples/host/cdc_msc_hid/src/tusb_config.h
index 9fef03af8..4b39d6d18 100644
--- a/examples/host/cdc_msc_hid/src/tusb_config.h
+++ b/examples/host/cdc_msc_hid/src/tusb_config.h
@@ -88,7 +88,7 @@
#define CFG_TUSB_HOST_HID_MOUSE 0
#define CFG_TUSB_HOST_HID_GENERIC 0 // (not yet supported)
#define CFG_TUSB_HOST_MSC 0
-#define CFG_TUSB_HOST_CDC 0
+#define CFG_TUSB_HOST_CDC 1
#define CFG_TUSB_HOST_DEVICE_MAX (CFG_TUSB_HOST_HUB ? 5 : 1) // normal hub has 4 ports