summaryrefslogtreecommitdiff
path: root/src/class/vendor
diff options
context:
space:
mode:
authorhathach <[email protected]>2026-03-11 20:11:41 +0700
committerhathach <[email protected]>2026-03-11 20:11:41 +0700
commitd74559ab70c7c4804ee8cf65d9c65d910af06870 (patch)
treebd2f424816fc04e2b7b2988439fd2473901f722d /src/class/vendor
parentd13f600721671a603579350be1e9c935a0d40547 (diff)
rename .rx_multiple_packet_transfer to .rx_need_zlp
Diffstat (limited to 'src/class/vendor')
-rw-r--r--src/class/vendor/vendor_device.c4
-rw-r--r--src/class/vendor/vendor_device.h11
2 files changed, 9 insertions, 6 deletions
diff --git a/src/class/vendor/vendor_device.c b/src/class/vendor/vendor_device.c
index b2dd8f394..c7ad8bd8c 100644
--- a/src/class/vendor/vendor_device.c
+++ b/src/class/vendor/vendor_device.c
@@ -71,7 +71,7 @@ typedef struct {
CFG_TUD_MEM_SECTION static vendord_epbuf_t _vendord_epbuf[CFG_TUD_VENDOR];
#endif
-static tud_vendor_configure_t _vendord_cfg = TUD_VENDOR_CONFIGURE_DEFAULT();
+static tud_vendor_configure_t _vendord_cfg = CFG_TUD_VENDOR_CONFIGURE_DEFAULT();
//--------------------------------------------------------------------+
// Weak stubs: invoked if no strong implementation is available
@@ -307,7 +307,7 @@ uint16_t vendord_open(uint8_t rhport, const tusb_desc_interface_t *desc_itf, uin
const tusb_desc_endpoint_t* desc_ep = (const tusb_desc_endpoint_t*) p_desc;
TU_ASSERT(usbd_edpt_open(rhport, desc_ep));
- uint16_t rx_xfer_len = _vendord_cfg.rx_multiple_packet_transfer ? CFG_TUD_VENDOR_EPSIZE : tu_edpt_packet_size(desc_ep);
+ uint16_t rx_xfer_len = _vendord_cfg.rx_need_zlp ? CFG_TUD_VENDOR_EPSIZE : tu_edpt_packet_size(desc_ep);
#if CFG_TUD_VENDOR_TXRX_BUFFERED
// open endpoint stream
diff --git a/src/class/vendor/vendor_device.h b/src/class/vendor/vendor_device.h
index 594da19cb..54f3548c7 100644
--- a/src/class/vendor/vendor_device.h
+++ b/src/class/vendor/vendor_device.h
@@ -66,13 +66,16 @@ extern "C" {
// Driver Configuration
//--------------------------------------------------------------------+
typedef struct TU_ATTR_PACKED {
- bool rx_multiple_packet_transfer : 1; // allow transfer more than one packet in a single transfer, increase throughput but requires host sending ZLP at the end of transfer
+ bool rx_need_zlp : 1; // requires host support ZLP, allow transfer more than one packet in a single transfer, better throughput.
} tud_vendor_configure_t;
TU_VERIFY_STATIC(sizeof(tud_vendor_configure_t) == 1, "size is not correct");
-#define TUD_VENDOR_CONFIGURE_DEFAULT() { \
- .rx_multiple_packet_transfer = false, \
-}
+#ifndef CFG_TUD_VENDOR_CONFIGURE_DEFAULT
+ #define CFG_TUD_VENDOR_CONFIGURE_DEFAULT() \
+ { \
+ .rx_need_zlp = false, \
+ }
+#endif
// Configure CDC driver behavior
bool tud_vendor_configure(const tud_vendor_configure_t* driver_cfg);