Skip to content

Commit 3122316

Browse files
MLXXXpfacchinm
authored andcommitted
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.
1 parent 10e0811 commit 3122316

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

cores/arduino/CDC.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,7 @@ bool CDC_Setup(USBSetup& setup)
9494
if (CDC_SET_CONTROL_LINE_STATE == r)
9595
{
9696
_usbLineInfo.lineState = setup.wValueL;
97-
}
9897

99-
if (CDC_SET_LINE_CODING == r || CDC_SET_CONTROL_LINE_STATE == r)
100-
{
10198
// auto-reset into the bootloader is triggered when the port, already
10299
// open at 1200 bps, is closed. this is the signal to start the watchdog
103100
// with a relatively long period so it can finish housekeeping tasks

0 commit comments

Comments
 (0)