summaryrefslogtreecommitdiff
path: root/src/class/cdc
diff options
context:
space:
mode:
authorhathach <[email protected]>2019-04-01 21:11:06 -0700
committerGitHub <[email protected]>2019-04-01 21:11:06 -0700
commit0848c462b3e431a9da42e96537d2b597a4579636 (patch)
tree746d6642e22e3ecf30d4f4c5f830c2a155bb28d7 /src/class/cdc
parent86c24b310509a368cc6a9dfbec43ce531e71d598 (diff)
parent2c1072c0aba48a2e6cbe93118c286b7999b0db43 (diff)
Merge pull request #51 from hathach/develop
Add suspend, resume and remote wakeup support
Diffstat (limited to 'src/class/cdc')
-rw-r--r--src/class/cdc/cdc_device.c2
-rw-r--r--src/class/cdc/cdc_device.h2
2 files changed, 1 insertions, 3 deletions
diff --git a/src/class/cdc/cdc_device.c b/src/class/cdc/cdc_device.c
index 2ac8d471c..c194aacd8 100644
--- a/src/class/cdc/cdc_device.c
+++ b/src/class/cdc/cdc_device.c
@@ -99,7 +99,7 @@ static void _prep_out_transaction (uint8_t itf)
bool tud_cdc_n_connected(uint8_t itf)
{
// DTR (bit 0) active is considered as connected
- return TU_BIT_TEST(_cdcd_itf[itf].line_state, 0);
+ return tud_ready() && TU_BIT_TEST(_cdcd_itf[itf].line_state, 0);
}
uint8_t tud_cdc_n_get_line_state (uint8_t itf)
diff --git a/src/class/cdc/cdc_device.h b/src/class/cdc/cdc_device.h
index 468edef45..25c721e13 100644
--- a/src/class/cdc/cdc_device.h
+++ b/src/class/cdc/cdc_device.h
@@ -38,7 +38,6 @@
#define CFG_TUD_CDC_EPSIZE 64
#endif
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -97,7 +96,6 @@ ATTR_WEAK void tud_cdc_line_coding_cb(uint8_t itf, cdc_line_coding_t const* p_li
//--------------------------------------------------------------------+
// INTERNAL USBD-CLASS DRIVER API
-
//--------------------------------------------------------------------+
void cdcd_init (void);
bool cdcd_open (uint8_t rhport, tusb_desc_interface_t const * p_interface_desc, uint16_t *p_length);