diff options
| author | hathach <[email protected]> | 2018-12-10 05:40:02 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-12-10 05:44:08 +0700 |
| commit | a31f83dbb0d123d15dcc393dd9d926a4cc7352b6 (patch) | |
| tree | 6319734b0e9096b41be6776bc1a240ab645d1431 /src/class/cdc | |
| parent | 75baedf27d09e57deb9d88cc7c82d95b0d530bca (diff) | |
removing pipe handle
Diffstat (limited to 'src/class/cdc')
| -rw-r--r-- | src/class/cdc/cdc_host.c | 13 | ||||
| -rw-r--r-- | src/class/cdc/cdc_host.h | 2 |
2 files changed, 3 insertions, 12 deletions
diff --git a/src/class/cdc/cdc_host.c b/src/class/cdc/cdc_host.c index 5e410fbf9..6eadca23d 100644 --- a/src/class/cdc/cdc_host.c +++ b/src/class/cdc/cdc_host.c @@ -57,15 +57,6 @@ //--------------------------------------------------------------------+
STATIC_VAR cdch_data_t cdch_data[CFG_TUSB_HOST_DEVICE_MAX]; // TODO to be static
-static inline cdc_pipeid_t get_app_pipeid(pipe_handle_t pipe_hdl)
-{
- cdch_data_t const * p_cdc = &cdch_data[pipe_hdl.dev_addr-1];
-
- return pipehandle_is_equal( pipe_hdl, p_cdc->pipe_notification ) ? CDC_PIPE_NOTIFICATION :
- pipehandle_is_equal( pipe_hdl, p_cdc->pipe_in ) ? CDC_PIPE_DATA_IN :
- pipehandle_is_equal( pipe_hdl, p_cdc->pipe_out ) ? CDC_PIPE_DATA_OUT : CDC_PIPE_ERROR;
-}
-
static inline bool tusbh_cdc_is_mounted(uint8_t dev_addr)
{
return pipehandle_is_valid(cdch_data[dev_addr-1].pipe_in) && pipehandle_is_valid(cdch_data[dev_addr-1].pipe_out);
@@ -221,9 +212,9 @@ bool cdch_open_subtask(uint8_t rhport, uint8_t dev_addr, tusb_desc_interface_t c return true;
}
-void cdch_isr(pipe_handle_t pipe_hdl, xfer_result_t event, uint32_t xferred_bytes)
+void cdch_isr(uint8_t dev_addr, xfer_result_t event, uint32_t xferred_bytes)
{
- tuh_cdc_xfer_isr( pipe_hdl.dev_addr, event, get_app_pipeid(pipe_hdl), xferred_bytes );
+ tuh_cdc_xfer_isr( dev_addr, event, 0, xferred_bytes );
}
void cdch_close(uint8_t dev_addr)
diff --git a/src/class/cdc/cdc_host.h b/src/class/cdc/cdc_host.h index faf4cfe93..02eaa16e4 100644 --- a/src/class/cdc/cdc_host.h +++ b/src/class/cdc/cdc_host.h @@ -151,7 +151,7 @@ extern cdch_data_t cdch_data[CFG_TUSB_HOST_DEVICE_MAX]; // TODO consider to move void cdch_init(void);
bool cdch_open_subtask(uint8_t rhport, uint8_t dev_addr, tusb_desc_interface_t const *p_interface_desc, uint16_t *p_length) ATTR_WARN_UNUSED_RESULT;
-void cdch_isr(pipe_handle_t pipe_hdl, xfer_result_t event, uint32_t xferred_bytes);
+void cdch_isr(uint8_t dev_addr, xfer_result_t event, uint32_t xferred_bytes);
void cdch_close(uint8_t dev_addr);
#endif
|
