From 52de428fbe036aa98cffe967d891f2e7db6c9ec3 Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 6 Mar 2018 17:14:35 +0700 Subject: [PATCH] rename to hal_dcd_pipe_xfer() --- hw/mcu/nxp/lpc43xx/tusb_port/dcd_lpc43xx.c | 2 +- tinyusb/class/cdc_device.c | 2 +- tinyusb/class/hid_device.c | 4 ++-- tinyusb/class/msc_device.c | 8 ++++---- tinyusb/device/dcd.h | 4 +++- tinyusb/device/dcd_lpc175x_6x.c | 2 +- tinyusb/device/dcd_lpc_11uxx_13uxx.c | 4 ++-- 7 files changed, 14 insertions(+), 12 deletions(-) diff --git a/hw/mcu/nxp/lpc43xx/tusb_port/dcd_lpc43xx.c b/hw/mcu/nxp/lpc43xx/tusb_port/dcd_lpc43xx.c index 2ac73968..933dda06 100644 --- a/hw/mcu/nxp/lpc43xx/tusb_port/dcd_lpc43xx.c +++ b/hw/mcu/nxp/lpc43xx/tusb_port/dcd_lpc43xx.c @@ -465,7 +465,7 @@ tusb_error_t dcd_pipe_queue_xfer(endpoint_handle_t edpt_hdl, uint8_t * buffer, u return pipe_add_xfer( edpt_hdl, buffer, total_bytes, false); } -tusb_error_t dcd_pipe_xfer(endpoint_handle_t edpt_hdl, uint8_t * buffer, uint16_t total_bytes, bool int_on_complete) +tusb_error_t hal_dcd_pipe_xfer(endpoint_handle_t edpt_hdl, uint8_t * buffer, uint16_t total_bytes, bool int_on_complete) { ASSERT_STATUS ( pipe_add_xfer(edpt_hdl, buffer, total_bytes, int_on_complete) ); diff --git a/tinyusb/class/cdc_device.c b/tinyusb/class/cdc_device.c index d0c41d55..9867b9e6 100644 --- a/tinyusb/class/cdc_device.c +++ b/tinyusb/class/cdc_device.c @@ -71,7 +71,7 @@ static tusb_error_t cdcd_xfer(uint8_t coreid, cdc_pipeid_t pipeid, void * p_buf cdcd_data_t* p_cdc = &cdcd_data[coreid]; ASSERT_FALSE ( dcd_pipe_is_busy(p_cdc->edpt_hdl[pipeid]), TUSB_ERROR_INTERFACE_IS_BUSY); - ASSERT_STATUS( dcd_pipe_xfer(p_cdc->edpt_hdl[pipeid], p_buffer, length, is_notify) ); + ASSERT_STATUS( hal_dcd_pipe_xfer(p_cdc->edpt_hdl[pipeid], p_buffer, length, is_notify) ); return TUSB_ERROR_NONE; } diff --git a/tinyusb/class/hid_device.c b/tinyusb/class/hid_device.c index 73dfde0b..a5fb8a92 100644 --- a/tinyusb/class/hid_device.c +++ b/tinyusb/class/hid_device.c @@ -118,7 +118,7 @@ tusb_error_t tud_hid_keyboard_send(uint8_t coreid, hid_keyboard_report_t const * hidd_interface_t * p_kbd = &keyboardd_data; // TODO &keyboardd_data[coreid]; - ASSERT_STATUS( dcd_pipe_xfer(p_kbd->ept_handle, (void*) p_report, sizeof(hid_keyboard_report_t), true) ) ; + ASSERT_STATUS( hal_dcd_pipe_xfer(p_kbd->ept_handle, (void*) p_report, sizeof(hid_keyboard_report_t), true) ) ; return TUSB_ERROR_NONE; } @@ -141,7 +141,7 @@ tusb_error_t tusbd_hid_mouse_send(uint8_t coreid, hid_mouse_report_t const *p_re hidd_interface_t * p_mouse = &moused_data; // TODO &keyboardd_data[coreid]; - ASSERT_STATUS( dcd_pipe_xfer(p_mouse->ept_handle, (void*) p_report, sizeof(hid_mouse_report_t), true) ) ; + ASSERT_STATUS( hal_dcd_pipe_xfer(p_mouse->ept_handle, (void*) p_report, sizeof(hid_mouse_report_t), true) ) ; return TUSB_ERROR_NONE; } diff --git a/tinyusb/class/msc_device.c b/tinyusb/class/msc_device.c index c2fec881..7e787c49 100644 --- a/tinyusb/class/msc_device.c +++ b/tinyusb/class/msc_device.c @@ -110,7 +110,7 @@ tusb_error_t mscd_open(uint8_t coreid, tusb_descriptor_interface_t const * p_int (*p_length) += sizeof(tusb_descriptor_interface_t) + 2*sizeof(tusb_descriptor_endpoint_t); //------------- Queue Endpoint OUT for Command Block Wrapper -------------// - ASSERT_STATUS( dcd_pipe_xfer(p_msc->edpt_out, (uint8_t*) &p_msc->cbw, sizeof(msc_cmd_block_wrapper_t), true) ); + ASSERT_STATUS( hal_dcd_pipe_xfer(p_msc->edpt_out, (uint8_t*) &p_msc->cbw, sizeof(msc_cmd_block_wrapper_t), true) ); return TUSB_ERROR_NONE; } @@ -207,10 +207,10 @@ tusb_error_t mscd_xfer_cb(endpoint_handle_t edpt_hdl, tusb_event_t event, uint32 // Either bulk in & out can be stalled in the data phase, dcd must make sure these queued transfer will be resumed after host clear stall if (!is_waiting_read10_write10) { - ASSERT_STATUS( dcd_pipe_xfer( p_msc->edpt_in , (uint8_t*) p_csw, sizeof(msc_cmd_status_wrapper_t), false) ); + ASSERT_STATUS( hal_dcd_pipe_xfer( p_msc->edpt_in , (uint8_t*) p_csw, sizeof(msc_cmd_status_wrapper_t), false) ); //------------- Queue the next CBW -------------// - ASSERT_STATUS( dcd_pipe_xfer( p_msc->edpt_out, (uint8_t*) p_cbw, sizeof(msc_cmd_block_wrapper_t), true) ); + ASSERT_STATUS( hal_dcd_pipe_xfer( p_msc->edpt_out, (uint8_t*) p_cbw, sizeof(msc_cmd_block_wrapper_t), true) ); } return TUSB_ERROR_NONE; @@ -246,7 +246,7 @@ static bool read10_write10_data_xfer(mscd_interface_t* p_msc) return true; } else if (xferred_block < block_count) { - ASSERT_STATUS( dcd_pipe_xfer( edpt_hdl, p_buffer, xferred_byte, true) ); + ASSERT_STATUS( hal_dcd_pipe_xfer( edpt_hdl, p_buffer, xferred_byte, true) ); // adjust lba, block_count, xfer_bytes for the next call p_readwrite->lba = __n2be(lba+xferred_block); diff --git a/tinyusb/device/dcd.h b/tinyusb/device/dcd.h index cd1f7578..5a4ada11 100644 --- a/tinyusb/device/dcd.h +++ b/tinyusb/device/dcd.h @@ -87,8 +87,10 @@ bool hal_dcd_control_xfer(uint8_t coreid, tusb_direction_t dir, uint8_t * p_buff void hal_dcd_control_stall(uint8_t coreid); bool hal_dcd_pipe_open(uint8_t coreid, tusb_descriptor_endpoint_t const * p_endpoint_desc, endpoint_handle_t* eh); + + tusb_error_t dcd_pipe_queue_xfer(endpoint_handle_t edpt_hdl, uint8_t * buffer, uint16_t total_bytes); // only queue, not transferring yet -tusb_error_t dcd_pipe_xfer(endpoint_handle_t edpt_hdl, uint8_t * buffer, uint16_t total_bytes, bool int_on_complete); +tusb_error_t hal_dcd_pipe_xfer(endpoint_handle_t edpt_hdl, uint8_t * buffer, uint16_t total_bytes, bool int_on_complete); tusb_error_t dcd_pipe_stall(endpoint_handle_t edpt_hdl); bool dcd_pipe_is_busy(endpoint_handle_t edpt_hdl); diff --git a/tinyusb/device/dcd_lpc175x_6x.c b/tinyusb/device/dcd_lpc175x_6x.c index ac2e4017..8d3c1a6d 100644 --- a/tinyusb/device/dcd_lpc175x_6x.c +++ b/tinyusb/device/dcd_lpc175x_6x.c @@ -490,7 +490,7 @@ tusb_error_t dcd_pipe_queue_xfer(endpoint_handle_t edpt_hdl, uint8_t * buffer, u return TUSB_ERROR_NONE; } -tusb_error_t dcd_pipe_xfer(endpoint_handle_t edpt_hdl, uint8_t* buffer, uint16_t total_bytes, bool int_on_complete) +tusb_error_t hal_dcd_pipe_xfer(endpoint_handle_t edpt_hdl, uint8_t* buffer, uint16_t total_bytes, bool int_on_complete) { dcd_dma_descriptor_t* const p_first_dd = &dcd_data.dd[edpt_hdl.index][0]; diff --git a/tinyusb/device/dcd_lpc_11uxx_13uxx.c b/tinyusb/device/dcd_lpc_11uxx_13uxx.c index b0e73ac9..3b315b31 100644 --- a/tinyusb/device/dcd_lpc_11uxx_13uxx.c +++ b/tinyusb/device/dcd_lpc_11uxx_13uxx.c @@ -108,7 +108,7 @@ typedef struct ATTR_PACKED STATIC_ASSERT( sizeof(dcd_11u_13u_qhd_t) == 4, "size is not correct" ); // NOTE data will be transferred as soon as dcd get request by dcd_pipe(_queue)_xfer using double buffering. -// If there is another dcd_pipe_xfer request, the new request will be saved and executed when the first is done. +// If there is another hal_dcd_pipe_xfer request, the new request will be saved and executed when the first is done. // next_td stored the 2nd request information // current_td is used to keep track of number of remaining & xferred bytes of the current request. // queued_bytes_in_buff keep track of number of bytes queued to each buffer (in case of short packet) @@ -550,7 +550,7 @@ tusb_error_t dcd_pipe_queue_xfer(endpoint_handle_t edpt_hdl, uint8_t * buffer, u return TUSB_ERROR_NONE; } -tusb_error_t dcd_pipe_xfer(endpoint_handle_t edpt_hdl, uint8_t* buffer, uint16_t total_bytes, bool int_on_complete) +tusb_error_t hal_dcd_pipe_xfer(endpoint_handle_t edpt_hdl, uint8_t* buffer, uint16_t total_bytes, bool int_on_complete) { if( dcd_pipe_is_busy(edpt_hdl) || dcd_pipe_is_stalled(edpt_hdl) ) { // save this transfer data to next td if pipe is busy or already been stalled