diff options
| author | hathach <[email protected]> | 2013-07-04 10:54:51 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-07-04 10:54:51 +0700 |
| commit | 8c0bc3871304201c2135504bbc18228de2e891d0 (patch) | |
| tree | deecc3202a14ac038e8be927d058f559aca114d8 | |
| parent | d3aed0187446ceffb6009a5f32a9f266a09bab29 (diff) | |
house keeping
| -rw-r--r-- | demos/host/src/cdc_serial_app.c | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/demos/host/src/cdc_serial_app.c b/demos/host/src/cdc_serial_app.c index 16a130c85..4cb4bc365 100644 --- a/demos/host/src/cdc_serial_app.c +++ b/demos/host/src/cdc_serial_app.c @@ -75,24 +75,33 @@ void tusbh_cdc_unmounted_isr(uint8_t dev_addr) void tusbh_cdc_xfer_isr(uint8_t dev_addr, tusb_event_t event, cdc_pipeid_t pipe_id, uint32_t xferred_bytes) { - switch(event) + if ( pipe_id == CDC_PIPE_DATA_IN ) { - case TUSB_EVENT_XFER_COMPLETE: - for(uint32_t i=0; i<xferred_bytes; i++) - { - osal_queue_send(queue_hdl, buffer_in+i); - } - tusbh_cdc_receive(dev_addr, buffer_in, sizeof(buffer_in), true); - break; + switch(event) + { + case TUSB_EVENT_XFER_COMPLETE: + for(uint32_t i=0; i<xferred_bytes; i++) + { + osal_queue_send(queue_hdl, buffer_in+i); + } + tusbh_cdc_receive(dev_addr, buffer_in, sizeof(buffer_in), true); + break; - case TUSB_EVENT_XFER_ERROR: - tusbh_cdc_receive(dev_addr, buffer_in, sizeof(buffer_in), true); // ignore & continue - break; + case TUSB_EVENT_XFER_ERROR: + tusbh_cdc_receive(dev_addr, buffer_in, sizeof(buffer_in), true); // ignore & continue + break; + + case TUSB_EVENT_XFER_STALLED: + default : + ASSERT(false, (void) 0); // error + break; + } + }else if (pipe_id == CDC_PIPE_DATA_OUT) + { + + }else if (pipe_id == CDC_PIPE_NOTIFICATION) + { - case TUSB_EVENT_XFER_STALLED: - default : - ASSERT(false, (void) 0); // error - break; } } |
