summaryrefslogtreecommitdiff
path: root/examples/host/cdc_msc_hid/src
diff options
context:
space:
mode:
authorhathach <[email protected]>2022-03-11 22:13:57 +0700
committerhathach <[email protected]>2022-03-11 22:13:57 +0700
commitec28593ce56a9a1726cfe8a43f6a8c421fd3916b (patch)
treef99b472023f88481f805105f920bb90c62f25e6d /examples/host/cdc_msc_hid/src
parentbcdeb386cc4d3afb3d7213c961e4611e511c4e97 (diff)
update hid,msc to new usbh control API
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
//--------------------------------------------------------------------+