From 31223160ebfeb6aef21dded0572003eedb2b8fd1 Mon Sep 17 00:00:00 2001 From: Scott Allen Date: Fri, 10 Mar 2017 16:18:20 -0500 Subject: Don't use line coding to trigger USB auto-reset An auto-reset invoked using USB CDC is triggered by the port closing (when set to 1200 baud). Closing of the port is indicated by DTR going inactive. There is no need to have auto-reset invoked by a CDC_SET_LINE_CODING command. Only the CDC_SET_CONTROL_LINE_STATE command, which indicates a change in the state of DTR, should be used. --- cores/arduino/CDC.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/cores/arduino/CDC.cpp b/cores/arduino/CDC.cpp index 125dc85..39373f6 100644 --- a/cores/arduino/CDC.cpp +++ b/cores/arduino/CDC.cpp @@ -94,10 +94,7 @@ bool CDC_Setup(USBSetup& setup) if (CDC_SET_CONTROL_LINE_STATE == r) { _usbLineInfo.lineState = setup.wValueL; - } - if (CDC_SET_LINE_CODING == r || CDC_SET_CONTROL_LINE_STATE == r) - { // auto-reset into the bootloader is triggered when the port, already // open at 1200 bps, is closed. this is the signal to start the watchdog // with a relatively long period so it can finish housekeeping tasks -- cgit v1.2.3-18-g5258