summaryrefslogtreecommitdiff
path: root/src/class/cdc/cdc_device.h
diff options
context:
space:
mode:
authorhathach <[email protected]>2024-07-19 18:08:04 +0700
committerhathach <[email protected]>2024-07-19 18:08:04 +0700
commit6fb6602a097b2d2e026f150d6fde387803606f88 (patch)
treeac566bc7aeaa907fe50d43fc234e64631a0144fb /src/class/cdc/cdc_device.h
parentbe18af823591389a12e246f65784646f93443882 (diff)
- add tud_cdc_n_ready() though not used
- usbd now change _usbd_dev.cfg_num before calling driver's open()
Diffstat (limited to 'src/class/cdc/cdc_device.h')
-rw-r--r--src/class/cdc/cdc_device.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/class/cdc/cdc_device.h b/src/class/cdc/cdc_device.h
index 34670517a..3ad7c8baf 100644
--- a/src/class/cdc/cdc_device.h
+++ b/src/class/cdc/cdc_device.h
@@ -61,6 +61,9 @@ bool tud_cdc_configure_fifo(tud_cdc_configure_fifo_t const* cfg);
// Application API (Multiple Ports) i.e. CFG_TUD_CDC > 1
//--------------------------------------------------------------------+
+// Check if interface is ready
+bool tud_cdc_n_ready(uint8_t itf);
+
// Check if terminal is connected to this port
bool tud_cdc_n_connected(uint8_t itf);
@@ -116,6 +119,11 @@ bool tud_cdc_n_write_clear(uint8_t itf);
//--------------------------------------------------------------------+
// Application API (Single Port)
//--------------------------------------------------------------------+
+
+TU_ATTR_ALWAYS_INLINE static inline bool tud_cdc_ready(void) {
+ return tud_cdc_n_ready(0);
+}
+
TU_ATTR_ALWAYS_INLINE static inline bool tud_cdc_connected(void) {
return tud_cdc_n_connected(0);
}