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/device/dcd.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'tinyusb/device') diff --git a/tinyusb/device/dcd.h b/tinyusb/device/dcd.h index d9b339740..cd1f7578d 100644 --- a/tinyusb/device/dcd.h +++ b/tinyusb/device/dcd.h @@ -63,12 +63,6 @@ typedef struct { uint8_t index; // must be zero to indicate control } endpoint_handle_t; -static inline bool endpointhandle_is_valid(endpoint_handle_t edpt_hdl) -{ - // Control does not use this to check - return edpt_hdl.index != 0; -} - static inline bool endpointhandle_is_equal(endpoint_handle_t x, endpoint_handle_t y) { return (x.coreid == y.coreid) && (x.index == y.index); @@ -92,7 +86,7 @@ void hal_dcd_setup_received(uint8_t coreid, uint8_t const* p_request); bool hal_dcd_control_xfer(uint8_t coreid, tusb_direction_t dir, uint8_t * p_buffer, uint16_t length, bool int_on_complete); void hal_dcd_control_stall(uint8_t coreid); -endpoint_handle_t hal_dcd_pipe_open(uint8_t coreid, tusb_descriptor_endpoint_t const * p_endpoint_desc); +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 dcd_pipe_stall(endpoint_handle_t edpt_hdl); -- cgit v1.3.1