diff options
Diffstat (limited to 'examples/host/cdc_msc_hid/src/main.c')
| -rw-r--r-- | examples/host/cdc_msc_hid/src/main.c | 39 |
1 files changed, 4 insertions, 35 deletions
diff --git a/examples/host/cdc_msc_hid/src/main.c b/examples/host/cdc_msc_hid/src/main.c index 091c002ac..1f4acb822 100644 --- a/examples/host/cdc_msc_hid/src/main.c +++ b/examples/host/cdc_msc_hid/src/main.c @@ -1,4 +1,4 @@ -/* +/* * The MIT License (MIT) * * Copyright (c) 2019 Ha Thach (tinyusb.org) @@ -35,7 +35,7 @@ //--------------------------------------------------------------------+ void led_blinking_task(void); -extern void cdc_task(void); +extern void cdc_app_task(void); extern void hid_app_task(void); /*------------- MAIN -------------*/ @@ -52,45 +52,14 @@ int main(void) { // tinyusb host task tuh_task(); - led_blinking_task(); - -#if CFG_TUH_CDC - cdc_task(); -#endif -#if CFG_TUH_HID + led_blinking_task(); + cdc_app_task(); hid_app_task(); -#endif } } //--------------------------------------------------------------------+ -// USB CDC -//--------------------------------------------------------------------+ -#if CFG_TUH_CDC -CFG_TUSB_MEM_SECTION static char serial_in_buffer[64] = { 0 }; - -// 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) event; - (void) pipe_id; - (void) xferred_bytes; - - printf(serial_in_buffer); - tu_memclr(serial_in_buffer, sizeof(serial_in_buffer)); - - tuh_cdc_receive(dev_addr, serial_in_buffer, sizeof(serial_in_buffer), true); // waiting for next data -} - -void cdc_task(void) -{ - -} - -#endif - -//--------------------------------------------------------------------+ // TinyUSB Callbacks //--------------------------------------------------------------------+ |
