@@ -373,14 +373,14 @@ uint32_t tuh_cdc_write(uint8_t idx, void const* buffer, uint32_t bufsize) {
373373 cdch_interface_t * p_cdc = get_itf (idx );
374374 TU_VERIFY (p_cdc );
375375
376- return tu_edpt_stream_write (& p_cdc -> stream .tx , buffer , bufsize );
376+ return tu_edpt_stream_write (p_cdc -> daddr , & p_cdc -> stream .tx , buffer , bufsize );
377377}
378378
379379uint32_t tuh_cdc_write_flush (uint8_t idx ) {
380380 cdch_interface_t * p_cdc = get_itf (idx );
381381 TU_VERIFY (p_cdc );
382382
383- return tu_edpt_stream_write_xfer (& p_cdc -> stream .tx );
383+ return tu_edpt_stream_write_xfer (p_cdc -> daddr , & p_cdc -> stream .tx );
384384}
385385
386386bool tuh_cdc_write_clear (uint8_t idx ) {
@@ -394,7 +394,7 @@ uint32_t tuh_cdc_write_available(uint8_t idx) {
394394 cdch_interface_t * p_cdc = get_itf (idx );
395395 TU_VERIFY (p_cdc );
396396
397- return tu_edpt_stream_write_available (& p_cdc -> stream .tx );
397+ return tu_edpt_stream_write_available (p_cdc -> daddr , & p_cdc -> stream .tx );
398398}
399399
400400//--------------------------------------------------------------------+
@@ -405,7 +405,7 @@ uint32_t tuh_cdc_read (uint8_t idx, void* buffer, uint32_t bufsize) {
405405 cdch_interface_t * p_cdc = get_itf (idx );
406406 TU_VERIFY (p_cdc );
407407
408- return tu_edpt_stream_read (& p_cdc -> stream .rx , buffer , bufsize );
408+ return tu_edpt_stream_read (p_cdc -> daddr , & p_cdc -> stream .rx , buffer , bufsize );
409409}
410410
411411uint32_t tuh_cdc_read_available (uint8_t idx ) {
@@ -427,7 +427,7 @@ bool tuh_cdc_read_clear (uint8_t idx) {
427427 TU_VERIFY (p_cdc );
428428
429429 bool ret = tu_edpt_stream_clear (& p_cdc -> stream .rx );
430- tu_edpt_stream_read_xfer (& p_cdc -> stream .rx );
430+ tu_edpt_stream_read_xfer (p_cdc -> daddr , & p_cdc -> stream .rx );
431431 return ret ;
432432}
433433
@@ -709,10 +709,10 @@ bool cdch_xfer_cb(uint8_t daddr, uint8_t ep_addr, xfer_result_t event, uint32_t
709709 // invoke tx complete callback to possibly refill tx fifo
710710 if (tuh_cdc_tx_complete_cb ) tuh_cdc_tx_complete_cb (idx );
711711
712- if ( 0 == tu_edpt_stream_write_xfer (& p_cdc -> stream .tx ) ) {
712+ if ( 0 == tu_edpt_stream_write_xfer (daddr , & p_cdc -> stream .tx ) ) {
713713 // If there is no data left, a ZLP should be sent if:
714714 // - xferred_bytes is multiple of EP Packet size and not zero
715- tu_edpt_stream_write_zlp_if_needed (& p_cdc -> stream .tx , xferred_bytes );
715+ tu_edpt_stream_write_zlp_if_needed (daddr , & p_cdc -> stream .tx , xferred_bytes );
716716 }
717717 } else if ( ep_addr == p_cdc -> stream .rx .ep_addr ) {
718718 #if CFG_TUH_CDC_FTDI
@@ -730,7 +730,7 @@ bool cdch_xfer_cb(uint8_t daddr, uint8_t ep_addr, xfer_result_t event, uint32_t
730730 if (tuh_cdc_rx_cb ) tuh_cdc_rx_cb (idx );
731731
732732 // prepare for next transfer if needed
733- tu_edpt_stream_read_xfer (& p_cdc -> stream .rx );
733+ tu_edpt_stream_read_xfer (daddr , & p_cdc -> stream .rx );
734734 }else if ( ep_addr == p_cdc -> ep_notif ) {
735735 // TODO handle notification endpoint
736736 }else {
@@ -751,9 +751,9 @@ static bool open_ep_stream_pair(cdch_interface_t* p_cdc, tusb_desc_endpoint_t co
751751 TU_ASSERT (tuh_edpt_open (p_cdc -> daddr , desc_ep ));
752752
753753 if (tu_edpt_dir (desc_ep -> bEndpointAddress ) == TUSB_DIR_IN ) {
754- tu_edpt_stream_open (& p_cdc -> stream .rx , p_cdc -> daddr , desc_ep );
754+ tu_edpt_stream_open (& p_cdc -> stream .rx , desc_ep );
755755 } else {
756- tu_edpt_stream_open (& p_cdc -> stream .tx , p_cdc -> daddr , desc_ep );
756+ tu_edpt_stream_open (& p_cdc -> stream .tx , desc_ep );
757757 }
758758
759759 desc_ep = (tusb_desc_endpoint_t const * ) tu_desc_next (desc_ep );
@@ -795,7 +795,7 @@ static void set_config_complete(cdch_interface_t * p_cdc, uint8_t idx, uint8_t i
795795 if (tuh_cdc_mount_cb ) tuh_cdc_mount_cb (idx );
796796
797797 // Prepare for incoming data
798- tu_edpt_stream_read_xfer (& p_cdc -> stream .rx );
798+ tu_edpt_stream_read_xfer (p_cdc -> daddr , & p_cdc -> stream .rx );
799799
800800 // notify usbh that driver enumeration is complete
801801 usbh_driver_set_config_complete (p_cdc -> daddr , itf_num );
0 commit comments