summaryrefslogtreecommitdiff
path: root/examples/host/cdc_msc_hid/src
diff options
context:
space:
mode:
authorhathach <[email protected]>2022-03-20 00:51:00 +0700
committerhathach <[email protected]>2022-03-20 00:51:00 +0700
commit45052c625e962fa908c3234c228fca43181436d6 (patch)
treeebc895fc17fe056108af39e90e8b87ed6b09d895 /examples/host/cdc_msc_hid/src
parentc0195fc6270394a489faf29fe8fc42dff48bcff1 (diff)
parentae531a79f654d566790a4daae350730cdc0a01e9 (diff)
Merge branch 'master' into pio-host
Diffstat (limited to 'examples/host/cdc_msc_hid/src')
-rw-r--r--examples/host/cdc_msc_hid/src/main.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/examples/host/cdc_msc_hid/src/main.c b/examples/host/cdc_msc_hid/src/main.c
index a14be05ea..0fc7ef146 100644
--- a/examples/host/cdc_msc_hid/src/main.c
+++ b/examples/host/cdc_msc_hid/src/main.c
@@ -71,20 +71,6 @@ int main(void)
#if CFG_TUH_CDC
CFG_TUSB_MEM_SECTION static char serial_in_buffer[64] = { 0 };
-void tuh_mount_cb(uint8_t dev_addr)
-{
- // application set-up
- printf("A device with address %d is mounted\r\n", dev_addr);
-
- tuh_cdc_receive(dev_addr, serial_in_buffer, sizeof(serial_in_buffer), true); // schedule first transfer
-}
-
-void tuh_umount_cb(uint8_t dev_addr)
-{
- // application tear-down
- printf("A device with address %d is unmounted \r\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)
{
@@ -109,6 +95,19 @@ void cdc_task(void)
// TinyUSB Callbacks
//--------------------------------------------------------------------+
+void tuh_mount_cb(uint8_t dev_addr)
+{
+ // application set-up
+ printf("A device with address %d is mounted\r\n", dev_addr);
+}
+
+void tuh_umount_cb(uint8_t dev_addr)
+{
+ // application tear-down
+ printf("A device with address %d is unmounted \r\n", dev_addr);
+}
+
+
//--------------------------------------------------------------------+
// Blinking Task
//--------------------------------------------------------------------+