@@ -373,14 +373,14 @@ uint32_t tuh_cdc_write(uint8_t idx, void const* buffer, uint32_t bufsize) {
373
373
cdch_interface_t * p_cdc = get_itf (idx );
374
374
TU_VERIFY (p_cdc );
375
375
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 );
377
377
}
378
378
379
379
uint32_t tuh_cdc_write_flush (uint8_t idx ) {
380
380
cdch_interface_t * p_cdc = get_itf (idx );
381
381
TU_VERIFY (p_cdc );
382
382
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 );
384
384
}
385
385
386
386
bool tuh_cdc_write_clear (uint8_t idx ) {
@@ -394,7 +394,7 @@ uint32_t tuh_cdc_write_available(uint8_t idx) {
394
394
cdch_interface_t * p_cdc = get_itf (idx );
395
395
TU_VERIFY (p_cdc );
396
396
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 );
398
398
}
399
399
400
400
//--------------------------------------------------------------------+
@@ -405,7 +405,7 @@ uint32_t tuh_cdc_read (uint8_t idx, void* buffer, uint32_t bufsize) {
405
405
cdch_interface_t * p_cdc = get_itf (idx );
406
406
TU_VERIFY (p_cdc );
407
407
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 );
409
409
}
410
410
411
411
uint32_t tuh_cdc_read_available (uint8_t idx ) {
@@ -427,7 +427,7 @@ bool tuh_cdc_read_clear (uint8_t idx) {
427
427
TU_VERIFY (p_cdc );
428
428
429
429
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 );
431
431
return ret ;
432
432
}
433
433
@@ -709,10 +709,10 @@ bool cdch_xfer_cb(uint8_t daddr, uint8_t ep_addr, xfer_result_t event, uint32_t
709
709
// invoke tx complete callback to possibly refill tx fifo
710
710
if (tuh_cdc_tx_complete_cb ) tuh_cdc_tx_complete_cb (idx );
711
711
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 ) ) {
713
713
// If there is no data left, a ZLP should be sent if:
714
714
// - 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 );
716
716
}
717
717
} else if ( ep_addr == p_cdc -> stream .rx .ep_addr ) {
718
718
#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
730
730
if (tuh_cdc_rx_cb ) tuh_cdc_rx_cb (idx );
731
731
732
732
// 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 );
734
734
}else if ( ep_addr == p_cdc -> ep_notif ) {
735
735
// TODO handle notification endpoint
736
736
}else {
@@ -751,9 +751,9 @@ static bool open_ep_stream_pair(cdch_interface_t* p_cdc, tusb_desc_endpoint_t co
751
751
TU_ASSERT (tuh_edpt_open (p_cdc -> daddr , desc_ep ));
752
752
753
753
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 );
755
755
} 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 );
757
757
}
758
758
759
759
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
795
795
if (tuh_cdc_mount_cb ) tuh_cdc_mount_cb (idx );
796
796
797
797
// 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 );
799
799
800
800
// notify usbh that driver enumeration is complete
801
801
usbh_driver_set_config_complete (p_cdc -> daddr , itf_num );
0 commit comments