diff options
| author | hathach <[email protected]> | 2018-03-06 16:50:50 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-03-06 16:50:50 +0700 |
| commit | c5cb58b2bb229e88747786d4c61cc145322bff8b (patch) | |
| tree | d2b7d78d375105371400f5cafec1714cff9398de /tinyusb/class | |
| parent | 85511e288d04d7ab9921e58b58f1628b4d18833c (diff) | |
remove class code in pipe open()
Diffstat (limited to 'tinyusb/class')
| -rw-r--r-- | tinyusb/class/cdc_device.c | 4 | ||||
| -rw-r--r-- | tinyusb/class/hid_device.c | 2 | ||||
| -rw-r--r-- | tinyusb/class/msc_device.c | 4 |
3 files changed, 6 insertions, 4 deletions
diff --git a/tinyusb/class/cdc_device.c b/tinyusb/class/cdc_device.c index b938b6c55..84027b5a6 100644 --- a/tinyusb/class/cdc_device.c +++ b/tinyusb/class/cdc_device.c @@ -135,7 +135,7 @@ tusb_error_t cdcd_open(uint8_t coreid, tusb_descriptor_interface_t const * p_int if ( TUSB_DESC_TYPE_ENDPOINT == p_desc[DESCRIPTOR_OFFSET_TYPE])
{ // notification endpoint if any
- p_cdc->edpt_hdl[CDC_PIPE_NOTIFICATION] = dcd_pipe_open(coreid, (tusb_descriptor_endpoint_t const *) p_desc, TUSB_CLASS_CDC);
+ p_cdc->edpt_hdl[CDC_PIPE_NOTIFICATION] = hal_dcd_pipe_open(coreid, (tusb_descriptor_endpoint_t const *) p_desc);
(*p_length) += p_desc[DESCRIPTOR_OFFSET_LENGTH];
p_desc = descriptor_next(p_desc);
@@ -160,7 +160,7 @@ tusb_error_t cdcd_open(uint8_t coreid, tusb_descriptor_interface_t const * p_int endpoint_handle_t * p_edpt_hdl = ( p_endpoint->bEndpointAddress & TUSB_DIR_DEV_TO_HOST_MASK ) ?
&p_cdc->edpt_hdl[CDC_PIPE_DATA_IN] : &p_cdc->edpt_hdl[CDC_PIPE_DATA_OUT] ;
- (*p_edpt_hdl) = dcd_pipe_open(coreid, p_endpoint, TUSB_CLASS_CDC);
+ (*p_edpt_hdl) = hal_dcd_pipe_open(coreid, p_endpoint);
ASSERT ( endpointhandle_is_valid(*p_edpt_hdl), TUSB_ERROR_DCD_OPEN_PIPE_FAILED );
(*p_length) += p_desc[DESCRIPTOR_OFFSET_LENGTH];
diff --git a/tinyusb/class/hid_device.c b/tinyusb/class/hid_device.c index 43f1546af..83c064115 100644 --- a/tinyusb/class/hid_device.c +++ b/tinyusb/class/hid_device.c @@ -280,7 +280,7 @@ tusb_error_t hidd_open(uint8_t coreid, tusb_descriptor_interface_t const * p_int ASSERT_PTR(p_hid, TUSB_ERROR_FAILED);
- p_hid->ept_handle = dcd_pipe_open(coreid, p_desc_endpoint, p_interface_desc->bInterfaceClass);
+ p_hid->ept_handle = hal_dcd_pipe_open(coreid, p_desc_endpoint);
ASSERT( endpointhandle_is_valid(p_hid->ept_handle), TUSB_ERROR_DCD_FAILED);
p_hid->interface_number = p_interface_desc->bInterfaceNumber;
diff --git a/tinyusb/class/msc_device.c b/tinyusb/class/msc_device.c index 5ac927fa1..d3ac68e83 100644 --- a/tinyusb/class/msc_device.c +++ b/tinyusb/class/msc_device.c @@ -101,7 +101,7 @@ tusb_error_t mscd_open(uint8_t coreid, tusb_descriptor_interface_t const * p_int endpoint_handle_t * p_edpt_hdl = ( p_endpoint->bEndpointAddress & TUSB_DIR_DEV_TO_HOST_MASK ) ?
&p_msc->edpt_in : &p_msc->edpt_out;
- (*p_edpt_hdl) = dcd_pipe_open(coreid, p_endpoint, p_interface_desc->bInterfaceClass);
+ (*p_edpt_hdl) = hal_dcd_pipe_open(coreid, p_endpoint);
ASSERT( endpointhandle_is_valid(*p_edpt_hdl), TUSB_ERROR_DCD_FAILED);
p_endpoint = (tusb_descriptor_endpoint_t const *) descriptor_next( (uint8_t const*) p_endpoint );
@@ -152,6 +152,8 @@ tusb_error_t mscd_xfer_cb(endpoint_handle_t edpt_hdl, tusb_event_t event, uint32 msc_cmd_block_wrapper_t * const p_cbw = &p_msc->cbw;
msc_cmd_status_wrapper_t * const p_csw = &p_msc->csw;
+ VERIFY(endpointhandle_is_equal(edpt_hdl, p_msc->edpt_out) || endpointhandle_is_equal(edpt_hdl, p_msc->edpt_in), TUSB_ERROR_INVALID_PARA);
+
//------------- new CBW received -------------//
if ( !is_waiting_read10_write10 )
{
|
