diff options
| author | hathach <[email protected]> | 2013-07-03 10:53:16 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-07-03 10:53:16 +0700 |
| commit | b3f98bc15a47bea88806cbfdc899d46efe40d921 (patch) | |
| tree | 30cfadb9e0cb4bf128bbdd2dd544e61ef8a259f8 /demos/host/src | |
| parent | 539c7cdbe16d7805eac053a6779f509a4c9b4c68 (diff) | |
rename cdc descriptor type
add tusbh_cdc_mounted_isr & tusbh_cdc_unmounted_isr
Diffstat (limited to 'demos/host/src')
| -rw-r--r-- | demos/host/src/cdc_serial_app.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/demos/host/src/cdc_serial_app.c b/demos/host/src/cdc_serial_app.c index 46f77a39b..5a5733c9c 100644 --- a/demos/host/src/cdc_serial_app.c +++ b/demos/host/src/cdc_serial_app.c @@ -58,19 +58,22 @@ static uint8_t buffer_in[64] TUSB_CFG_ATTR_USBRAM; //--------------------------------------------------------------------+ // INTERNAL OBJECT & FUNCTION DECLARATION //--------------------------------------------------------------------+ +void tusbh_cdc_mounted_isr(uint8_t dev_addr) +{ + // application set-up + osal_queue_flush(queue_hdl); + tusbh_cdc_receive(dev_addr, buffer_in, sizeof(buffer_in), true); // first report +} + +void tusbh_cdc_unmounted_isr(uint8_t dev_addr) +{ + // application tear-down +} + void tusbh_cdc_isr(uint8_t dev_addr, tusb_event_t event) { switch(event) { - case TUSB_EVENT_INTERFACE_OPEN: // application set-up - osal_queue_flush(queue_hdl); - tusbh_cdc_receive(dev_addr, buffer_in, sizeof(buffer_in), true); // first report - break; - - case TUSB_EVENT_INTERFACE_CLOSE: // application tear-down - - break; - case TUSB_EVENT_XFER_COMPLETE: // osal_queue_send(queue_hdl, &usb_keyboard_report); tusbh_cdc_receive(dev_addr, buffer_in, sizeof(buffer_in), true); |
