summaryrefslogtreecommitdiff
path: root/src/class/cdc/cdc_device.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/class/cdc/cdc_device.h')
-rw-r--r--src/class/cdc/cdc_device.h40
1 files changed, 21 insertions, 19 deletions
diff --git a/src/class/cdc/cdc_device.h b/src/class/cdc/cdc_device.h
index 0348bd2ec..9ac6bc58a 100644
--- a/src/class/cdc/cdc_device.h
+++ b/src/class/cdc/cdc_device.h
@@ -70,30 +70,32 @@
#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, \
- }
+// Keep rx fifo data even with bus reset or disconnect
+#ifndef CFG_TUD_CDC_RX_PERSISTENT
+ #define CFG_TUD_CDC_RX_PERSISTENT 0
#endif
-//--------------------------------------------------------------------+
-// Driver Configuration
-//--------------------------------------------------------------------+
+// Keep tx fifo data even with bus reset or disconnect
+#ifndef CFG_TUD_CDC_TX_PERSISTENT
+ #define CFG_TUD_CDC_TX_PERSISTENT 0
+#endif
+
+// If not connected, tx fifo can be overwritten
+#ifndef CFG_TUD_CDC_TX_OVERWRITABLE_IF_NOT_CONNECTED
+ #define CFG_TUD_CDC_TX_OVERWRITABLE_IF_NOT_CONNECTED 1
+#endif
+
+// Backward compatible: tud_cdc_configure_t and tud_cdc_configure() are no longer used.
+// Configuration is now done via compile-time macros above.
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_persistent;
+ bool tx_persistent;
+ bool tx_overwritabe_if_not_connected;
} tud_cdc_configure_t;
-// Configure CDC driver behavior
-bool tud_cdc_configure(const tud_cdc_configure_t* driver_cfg);
-
-// Backward compatible
-#define tud_cdc_configure_fifo_t tud_cdc_configure_t
-#define tud_cdc_configure_fifo tud_cdc_configure
+#define tud_cdc_configure(_cfg) ((void)(_cfg))
+#define tud_cdc_configure_fifo_t tud_cdc_configure_t
+#define tud_cdc_configure_fifo(_cfg) ((void)(_cfg))
//--------------------------------------------------------------------+
// Application API (Multiple Ports) i.e. CFG_TUD_CDC > 1