From 59a3720795681ad05157016bd21090340a298af7 Mon Sep 17 00:00:00 2001 From: YixingShen Date: Mon, 7 Jul 2025 00:26:12 +0800 Subject: [PATCH] fixed CFG_TUD_VENDOR > 1 vendord_open tud_vendor_n_write_flush tud_vendor_n_write_flush argument should be 0,1,2,..., but p_vendor - _vendord_itf is 0, sizeof(vendord_interface_t), 2*sizeof(vendord_interface_t), ... --- src/class/vendor/vendor_device.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/class/vendor/vendor_device.c b/src/class/vendor/vendor_device.c index 7f1fd8c41..df1518111 100644 --- a/src/class/vendor/vendor_device.c +++ b/src/class/vendor/vendor_device.c @@ -201,9 +201,10 @@ uint16_t vendord_open(uint8_t rhport, const tusb_desc_interface_t* desc_itf, uin // Find available interface vendord_interface_t* p_vendor = NULL; - for(uint8_t i=0; ibEndpointAddress) == TUSB_DIR_IN) { if (p_vendor->tx.stream.ep_addr == 0) { tu_edpt_stream_open(&p_vendor->tx.stream, desc_ep); - tud_vendor_n_write_flush((uint8_t)(p_vendor - _vendord_itf)); + tud_vendor_n_write_flush(itf); } } else { if (p_vendor->rx.stream.ep_addr == 0) {