From 539fbe5d6276575d3f2dd943b7d5d7463a522732 Mon Sep 17 00:00:00 2001 From: hathach Date: Sun, 11 Mar 2018 12:37:07 +0700 Subject: rename endpoint_handle_t to edpt_hdl_t --- tinyusb/class/cdc/cdc_device.c | 8 ++++---- tinyusb/class/cdc/cdc_device.h | 2 +- tinyusb/class/hid/hid_device.c | 4 ++-- tinyusb/class/hid/hid_device.h | 2 +- tinyusb/class/msc/msc_device.c | 10 +++++----- tinyusb/class/msc/msc_device.h | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) (limited to 'tinyusb/class') diff --git a/tinyusb/class/cdc/cdc_device.c b/tinyusb/class/cdc/cdc_device.c index 657bac860..c121a97f7 100644 --- a/tinyusb/class/cdc/cdc_device.c +++ b/tinyusb/class/cdc/cdc_device.c @@ -58,7 +58,7 @@ typedef struct { bool connected; - endpoint_handle_t edpt_hdl[3]; // notification, data in, data out + edpt_hdl_t edpt_hdl[3]; // notification, data in, data out }cdcd_data_t; // TODO multiple port @@ -177,7 +177,7 @@ tusb_error_t cdcd_open(uint8_t port, tusb_descriptor_interface_t const * p_inter ASSERT_(TUSB_DESC_TYPE_ENDPOINT == p_endpoint->bDescriptorType, TUSB_ERROR_DESCRIPTOR_CORRUPTED); ASSERT_(TUSB_XFER_BULK == p_endpoint->bmAttributes.xfer, TUSB_ERROR_DESCRIPTOR_CORRUPTED); - endpoint_handle_t * p_edpt_hdl = ( p_endpoint->bEndpointAddress & TUSB_DIR_DEV_TO_HOST_MASK ) ? + edpt_hdl_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] ; ASSERT_( hal_dcd_pipe_open(port, p_endpoint, p_edpt_hdl), TUSB_ERROR_DCD_OPEN_PIPE_FAILED); @@ -255,7 +255,7 @@ tusb_error_t cdcd_control_request_subtask(uint8_t port, tusb_control_request_t c return TUSB_ERROR_NONE; } -tusb_error_t cdcd_xfer_cb(endpoint_handle_t edpt_hdl, tusb_event_t event, uint32_t xferred_bytes) +tusb_error_t cdcd_xfer_cb(edpt_hdl_t edpt_hdl, tusb_event_t event, uint32_t xferred_bytes) { cdcd_data_t const * p_cdc = &cdcd_data[edpt_hdl.port]; @@ -277,7 +277,7 @@ void cdcd_sof(uint8_t port) { if ( !tud_cdc_connected(port) ) return; - endpoint_handle_t ep = cdcd_data[port].edpt_hdl[CDC_PIPE_DATA_IN]; + edpt_hdl_t ep = cdcd_data[port].edpt_hdl[CDC_PIPE_DATA_IN]; if ( !dcd_pipe_is_busy( ep ) ) { diff --git a/tinyusb/class/cdc/cdc_device.h b/tinyusb/class/cdc/cdc_device.h index 942d447b7..aaf7920a2 100644 --- a/tinyusb/class/cdc/cdc_device.h +++ b/tinyusb/class/cdc/cdc_device.h @@ -79,7 +79,7 @@ void tud_cdc_rx_cb(uint8_t port); void cdcd_init(void); tusb_error_t cdcd_open(uint8_t port, tusb_descriptor_interface_t const * p_interface_desc, uint16_t *p_length); tusb_error_t cdcd_control_request_subtask(uint8_t port, tusb_control_request_t const * p_request); -tusb_error_t cdcd_xfer_cb(endpoint_handle_t edpt_hdl, tusb_event_t event, uint32_t xferred_bytes); +tusb_error_t cdcd_xfer_cb(edpt_hdl_t edpt_hdl, tusb_event_t event, uint32_t xferred_bytes); void cdcd_close(uint8_t port); void cdcd_sof(uint8_t port); diff --git a/tinyusb/class/hid/hid_device.c b/tinyusb/class/hid/hid_device.c index 0fd4120ed..91ca53e78 100644 --- a/tinyusb/class/hid/hid_device.c +++ b/tinyusb/class/hid/hid_device.c @@ -59,7 +59,7 @@ typedef struct { uint8_t const * p_report_desc; uint16_t report_length; - endpoint_handle_t ept_handle; + edpt_hdl_t ept_handle; uint8_t interface_number; }hidd_interface_t; @@ -303,7 +303,7 @@ tusb_error_t hidd_open(uint8_t port, tusb_descriptor_interface_t const * p_inter return TUSB_ERROR_NONE; } -tusb_error_t hidd_xfer_cb(endpoint_handle_t edpt_hdl, tusb_event_t event, uint32_t xferred_bytes) +tusb_error_t hidd_xfer_cb(edpt_hdl_t edpt_hdl, tusb_event_t event, uint32_t xferred_bytes) { for(uint8_t i=0; ibDescriptorType && TUSB_XFER_BULK == p_endpoint->bmAttributes.xfer, TUSB_ERROR_DESCRIPTOR_CORRUPTED); - endpoint_handle_t * p_edpt_hdl = ( p_endpoint->bEndpointAddress & TUSB_DIR_DEV_TO_HOST_MASK ) ? + edpt_hdl_t * p_edpt_hdl = ( p_endpoint->bEndpointAddress & TUSB_DIR_DEV_TO_HOST_MASK ) ? &p_msc->edpt_in : &p_msc->edpt_out; VERIFY( hal_dcd_pipe_open(port, p_endpoint, p_edpt_hdl), TUSB_ERROR_DCD_FAILED ); @@ -142,7 +142,7 @@ tusb_error_t mscd_control_request_subtask(uint8_t port, tusb_control_request_t c //--------------------------------------------------------------------+ // MSCD APPLICATION CALLBACK //--------------------------------------------------------------------+ -tusb_error_t mscd_xfer_cb(endpoint_handle_t edpt_hdl, tusb_event_t event, uint32_t xferred_bytes) +tusb_error_t mscd_xfer_cb(edpt_hdl_t edpt_hdl, tusb_event_t event, uint32_t xferred_bytes) { static bool is_waiting_read10_write10 = false; // indicate we are transferring data in READ10, WRITE10 command @@ -182,7 +182,7 @@ tusb_error_t mscd_xfer_cb(endpoint_handle_t edpt_hdl, tusb_event_t event, uint32 ASSERT( p_cbw->xfer_bytes >= actual_length, TUSB_ERROR_INVALID_PARA ); ASSERT( sizeof(p_msc->scsi_data) >= actual_length, TUSB_ERROR_NOT_ENOUGH_MEMORY); // needs to increase size for scsi_data - endpoint_handle_t const edpt_data = BIT_TEST_(p_cbw->dir, 7) ? p_msc->edpt_in : p_msc->edpt_out; + edpt_hdl_t const edpt_data = BIT_TEST_(p_cbw->dir, 7) ? p_msc->edpt_in : p_msc->edpt_out; if ( p_buffer == NULL || actual_length == 0 ) { // application does not provide data to response --> possibly unsupported SCSI command @@ -224,7 +224,7 @@ static bool read10_write10_data_xfer(mscd_interface_t* p_msc) scsi_read10_t* p_readwrite = (scsi_read10_t*) &p_cbw->command; // read10 & write10 has the same format - endpoint_handle_t const edpt_hdl = BIT_TEST_(p_cbw->dir, 7) ? p_msc->edpt_in : p_msc->edpt_out; + edpt_hdl_t const edpt_hdl = BIT_TEST_(p_cbw->dir, 7) ? p_msc->edpt_in : p_msc->edpt_out; uint32_t const lba = __be2n(p_readwrite->lba); uint16_t const block_count = __be2n_16(p_readwrite->block_count); diff --git a/tinyusb/class/msc/msc_device.h b/tinyusb/class/msc/msc_device.h index 0fde78a47..1c8e3c8f9 100644 --- a/tinyusb/class/msc/msc_device.h +++ b/tinyusb/class/msc/msc_device.h @@ -124,7 +124,7 @@ msc_csw_status_t tud_msc_scsi_cb (uint8_t port, uint8_t lun, uint8_t scsi_cmd[16 void mscd_init(void); tusb_error_t mscd_open(uint8_t port, tusb_descriptor_interface_t const * p_interface_desc, uint16_t *p_length); tusb_error_t mscd_control_request_subtask(uint8_t port, tusb_control_request_t const * p_request); -tusb_error_t mscd_xfer_cb(endpoint_handle_t edpt_hdl, tusb_event_t event, uint32_t xferred_bytes); +tusb_error_t mscd_xfer_cb(edpt_hdl_t edpt_hdl, tusb_event_t event, uint32_t xferred_bytes); void mscd_close(uint8_t port); #endif -- cgit v1.3.1