summaryrefslogtreecommitdiff
path: root/src/class/cdc
diff options
context:
space:
mode:
Diffstat (limited to 'src/class/cdc')
-rw-r--r--src/class/cdc/cdc_device.c2
-rw-r--r--src/class/cdc/cdc_device.h7
2 files changed, 6 insertions, 3 deletions
diff --git a/src/class/cdc/cdc_device.c b/src/class/cdc/cdc_device.c
index 3f207462e..c7547c92b 100644
--- a/src/class/cdc/cdc_device.c
+++ b/src/class/cdc/cdc_device.c
@@ -356,7 +356,7 @@ uint16_t cdcd_open(uint8_t rhport, const tusb_desc_interface_t* itf_desc, uint16
} else {
tu_edpt_stream_t *stream_rx = &p_cdc->rx_stream;
tu_edpt_stream_open(stream_rx, rhport, desc_ep,
- _cdcd_cfg.rx_need_zlp ? CFG_TUD_CDC_RX_EPSIZE : tu_edpt_packet_size(desc_ep));
+ CFG_TUD_CDC_RX_NEED_ZLP ? CFG_TUD_CDC_RX_EPSIZE : tu_edpt_packet_size(desc_ep));
if (!_cdcd_cfg.rx_persistent) {
tu_edpt_stream_clear(stream_rx);
}
diff --git a/src/class/cdc/cdc_device.h b/src/class/cdc/cdc_device.h
index 3baf84d00..0348bd2ec 100644
--- a/src/class/cdc/cdc_device.h
+++ b/src/class/cdc/cdc_device.h
@@ -65,13 +65,17 @@
#endif
#endif
+// Enable multi-packet RX transfer with ZLP termination for better throughput. Requires host support for ZLP.
+#ifndef CFG_TUD_CDC_RX_NEED_ZLP
+ #define CFG_TUD_CDC_RX_NEED_ZLP 0
+#endif
+
#ifndef CFG_TUD_CDC_CONFIGURE_DEFAULT
#define CFG_TUD_CDC_CONFIGURE_DEFAULT() \
{ \
.rx_persistent = false, \
.tx_persistent = false, \
.tx_overwritabe_if_not_connected = true, \
- .rx_need_zlp = false \
}
#endif
@@ -82,7 +86,6 @@ typedef struct {
bool rx_persistent; // keep rx fifo data even with bus reset or disconnect
bool tx_persistent; // keep tx fifo data even with reset or disconnect
bool tx_overwritabe_if_not_connected; // if not connected, tx fifo can be overwritten
- bool rx_need_zlp; // requires host support ZLP, allow transfer more than one packet in a single transfer, better throughput.
} tud_cdc_configure_t;
// Configure CDC driver behavior