kopia lustrzana https://github.com/micropython/micropython
tools/pyboard.py: Set DTR on Windows to avoid ESPxx hard reset.
Fixes issue #9659. Signed-off-by: Jos Verlinde <Jos.Verlinde@Microsoft.com>pull/10347/head
rodzic
aa64280666
commit
d263438a6e
|
@ -286,7 +286,15 @@ class Pyboard:
|
||||||
delayed = False
|
delayed = False
|
||||||
for attempt in range(wait + 1):
|
for attempt in range(wait + 1):
|
||||||
try:
|
try:
|
||||||
self.serial = serial.Serial(device, **serial_kwargs)
|
if os.name == "nt":
|
||||||
|
# Windows does not set DTR or RTS by default
|
||||||
|
self.serial = serial.Serial(**serial_kwargs)
|
||||||
|
self.serial.dtr = True
|
||||||
|
self.serial.rts = False
|
||||||
|
self.serial.port = device
|
||||||
|
self.serial.open()
|
||||||
|
else:
|
||||||
|
self.serial = serial.Serial(device, **serial_kwargs)
|
||||||
break
|
break
|
||||||
except (OSError, IOError): # Py2 and Py3 have different errors
|
except (OSError, IOError): # Py2 and Py3 have different errors
|
||||||
if wait == 0:
|
if wait == 0:
|
||||||
|
|
Ładowanie…
Reference in New Issue