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.
This commit is contained in:
Scott Allen 2017-03-10 16:18:20 -05:00 committed by Martino Facchin
parent 10e0811c52
commit 31223160eb
1 changed files with 0 additions and 3 deletions

View File

@ -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