aboutsummaryrefslogtreecommitdiff
path: root/src/stm32/cdcacm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stm32/cdcacm.c')
-rw-r--r--src/stm32/cdcacm.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/stm32/cdcacm.c b/src/stm32/cdcacm.c
index 9cbd44b..a4f0527 100644
--- a/src/stm32/cdcacm.c
+++ b/src/stm32/cdcacm.c
@@ -46,6 +46,7 @@
static char *get_dev_unique_id(char *serial_no);
static int configured;
+static int cdcacm_gdb_dtr;
static const struct usb_device_descriptor dev = {
.bLength = USB_DT_DEVICE_SIZE,
@@ -346,9 +347,12 @@ static int cdcacm_control_request(struct usb_setup_data *req, uint8_t **buf,
switch(req->bRequest) {
case USB_CDC_REQ_SET_CONTROL_LINE_STATE:
- /* This Linux cdc_acm driver requires this to be implemented
- * even though it's optional in the CDC spec, and we don't
- * advertise it in the ACM functional descriptor. */
+ /* Ignore if not for GDB interface */
+ if(req->wIndex != 0)
+ return 1;
+
+ cdcacm_gdb_dtr = req->wValue & 1;
+
return 1;
#ifdef INCLUDE_UART_INTERFACE
case USB_CDC_REQ_SET_LINE_CODING: {
@@ -402,6 +406,11 @@ int cdcacm_get_config(void)
return configured;
}
+int cdcacm_get_dtr(void)
+{
+ return cdcacm_gdb_dtr;
+}
+
#ifdef INCLUDE_UART_INTERFACE
static void cdcacm_data_rx_cb(u8 ep)
{