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/device/dcd.h | |
| parent | 85511e288d04d7ab9921e58b58f1628b4d18833c (diff) | |
remove class code in pipe open()
Diffstat (limited to 'tinyusb/device/dcd.h')
| -rw-r--r-- | tinyusb/device/dcd.h | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/tinyusb/device/dcd.h b/tinyusb/device/dcd.h index 2fa8f1b86..d9b339740 100644 --- a/tinyusb/device/dcd.h +++ b/tinyusb/device/dcd.h @@ -60,21 +60,18 @@ typedef enum // TODO move Hal
typedef struct {
uint8_t coreid;
- uint8_t reserved; // TODO redundant, cannot be control as control uses separated API
- uint8_t index;
- uint8_t class_code;
+ uint8_t index; // must be zero to indicate control
} endpoint_handle_t;
-static inline bool endpointhandle_is_valid(endpoint_handle_t edpt_hdl) ATTR_CONST ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
static inline bool endpointhandle_is_valid(endpoint_handle_t edpt_hdl)
{
- return (edpt_hdl.class_code != 0);
+ // 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) ATTR_CONST ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
static inline bool endpointhandle_is_equal(endpoint_handle_t x, endpoint_handle_t y)
{
- return (x.coreid == y.coreid) && (x.index == y.index) && (x.class_code == y.class_code);
+ return (x.coreid == y.coreid) && (x.index == y.index);
}
@@ -95,7 +92,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 dcd_pipe_open(uint8_t coreid, tusb_descriptor_endpoint_t const * p_endpoint_desc, uint8_t class_code);
+endpoint_handle_t hal_dcd_pipe_open(uint8_t coreid, tusb_descriptor_endpoint_t const * p_endpoint_desc);
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);
|
