From 7092db264f9284c23d777562947111369baf7f68 Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 7 Mar 2018 15:30:32 +0700 Subject: update --- tinyusb/class/cdc/cdc_device.c | 17 +++++++++++------ tinyusb/class/cdc/cdc_device.h | 2 ++ 2 files changed, 13 insertions(+), 6 deletions(-) (limited to 'tinyusb/class') diff --git a/tinyusb/class/cdc/cdc_device.c b/tinyusb/class/cdc/cdc_device.c index f15255e4a..56a42032e 100644 --- a/tinyusb/class/cdc/cdc_device.c +++ b/tinyusb/class/cdc/cdc_device.c @@ -231,15 +231,20 @@ tusb_error_t cdcd_xfer_cb(endpoint_handle_t edpt_hdl, tusb_event_t event, uint32 { cdcd_data_t const * p_cdc = &cdcd_data[edpt_hdl.coreid]; - for(cdc_pipeid_t pipeid=CDC_PIPE_NOTIFICATION; pipeid < CDC_PIPE_ERROR; pipeid++ ) + if ( endpointhandle_is_equal(edpt_hdl, p_cdc->edpt_hdl[CDC_PIPE_DATA_OUT]) ) { - if ( endpointhandle_is_equal(edpt_hdl, p_cdc->edpt_hdl[pipeid]) ) - { - tud_cdc_xfer_cb(edpt_hdl.coreid, event, pipeid, xferred_bytes); - break; - } + tud_cdc_rx_cb(edpt_hdl.coreid, xferred_bytes); } +// for(cdc_pipeid_t pipeid=CDC_PIPE_NOTIFICATION; pipeid < CDC_PIPE_ERROR; pipeid++ ) +// { +// if ( endpointhandle_is_equal(edpt_hdl, p_cdc->edpt_hdl[pipeid]) ) +// { +// tud_cdc_xfer_cb(edpt_hdl.coreid, event, pipeid, xferred_bytes); +// break; +// } +// } + return TUSB_ERROR_NONE; } diff --git a/tinyusb/class/cdc/cdc_device.h b/tinyusb/class/cdc/cdc_device.h index 1f738aa7f..44351aad1 100644 --- a/tinyusb/class/cdc/cdc_device.h +++ b/tinyusb/class/cdc/cdc_device.h @@ -109,6 +109,8 @@ tusb_error_t tud_cdc_receive(uint8_t coreid, void * p_buffer, uint32_t length, b void tud_cdc_xfer_cb(uint8_t coreid, tusb_event_t event, cdc_pipeid_t pipe_id, uint32_t xferred_bytes); //void tud_cdc_line_coding_changed_cb(uint8_t coreid, cdc_line_coding_t* p_line_coding); +void tud_cdc_rx_cb(uint8_t coreid, uint32_t xferred_bytes); + //--------------------------------------------------------------------+ // USBD-CLASS DRIVER API //--------------------------------------------------------------------+ -- cgit v1.3.1