From fbeb30a71d8afbcbbdbb312c018f3fb7a7c1f7a0 Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 6 Mar 2018 17:03:19 +0700 Subject: change hal_dcd_pipe_open() signature to return bool - remove endpointhandle_is_valid() --- tinyusb/class/cdc_device.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'tinyusb/class/cdc_device.c') diff --git a/tinyusb/class/cdc_device.c b/tinyusb/class/cdc_device.c index 84027b5a6..d0c41d557 100644 --- a/tinyusb/class/cdc_device.c +++ b/tinyusb/class/cdc_device.c @@ -135,12 +135,10 @@ 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] = hal_dcd_pipe_open(coreid, (tusb_descriptor_endpoint_t const *) p_desc); + VERIFY( hal_dcd_pipe_open(coreid, (tusb_descriptor_endpoint_t const *) p_desc, &p_cdc->edpt_hdl[CDC_PIPE_NOTIFICATION]), TUSB_ERROR_DCD_OPEN_PIPE_FAILED); (*p_length) += p_desc[DESCRIPTOR_OFFSET_LENGTH]; p_desc = descriptor_next(p_desc); - - ASSERT(endpointhandle_is_valid(p_cdc->edpt_hdl[CDC_PIPE_NOTIFICATION]), TUSB_ERROR_DCD_OPEN_PIPE_FAILED); } //------------- Data Interface (if any) -------------// @@ -160,8 +158,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) = hal_dcd_pipe_open(coreid, p_endpoint); - ASSERT ( endpointhandle_is_valid(*p_edpt_hdl), TUSB_ERROR_DCD_OPEN_PIPE_FAILED ); + VERIFY( hal_dcd_pipe_open(coreid, p_endpoint, p_edpt_hdl), TUSB_ERROR_DCD_OPEN_PIPE_FAILED); (*p_length) += p_desc[DESCRIPTOR_OFFSET_LENGTH]; p_desc = descriptor_next( p_desc ); -- cgit v1.3.1