From 321324a485190a9dce2c49ef7019fc0eda83299b Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 7 Mar 2018 11:01:23 +0700 Subject: enhance cdc implementation --- tinyusb/class/cdc/cdc_device.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'tinyusb/class') diff --git a/tinyusb/class/cdc/cdc_device.c b/tinyusb/class/cdc/cdc_device.c index 9867b9e6c..f15255e4a 100644 --- a/tinyusb/class/cdc/cdc_device.c +++ b/tinyusb/class/cdc/cdc_device.c @@ -103,7 +103,13 @@ void cdcd_init(void) // default line coding is : stop bit = 1, parity = none, data bits = 8 memclr_(cdcd_line_coding, sizeof(cdc_line_coding_t)*CONTROLLER_DEVICE_NUMBER); - for(uint8_t i=0; iwValue == ACTIVE_DTE_PRESENT) + { + // terminal connected + } + else if (p_request->wValue == ACTIVE_DTE_NOT_PRESENT) + { + // terminal disconnected + }else + { + // De-active --> disconnected + } + } break; default: return TUSB_ERROR_DCD_CONTROL_REQUEST_NOT_SUPPORT; -- cgit v1.3.1