serialhdl: Don't open port at 1200 baud

The 1200 baud trick on the Arduino Due does both a reset and an
erase.  The erase is not desired.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2017-10-12 21:21:49 -04:00
parent 07a69df62f
commit e0f275cddf
2 changed files with 10 additions and 10 deletions

View File

@ -256,13 +256,13 @@ pin_map: arduino
#restart_method: arduino #restart_method: arduino
# This controls the mechanism the host will use to reset the # This controls the mechanism the host will use to reset the
# micro-controller. The choices are 'arduino', 'rpi_usb', and # micro-controller. The choices are 'arduino', 'rpi_usb', and
# 'command'. The 'arduino' method (toggle DTR; set baud to 1200) is # 'command'. The 'arduino' method (toggle DTR) is common on Arduino
# common on Arduino boards and clones. The 'rpi_usb' method is # boards and clones. The 'rpi_usb' method is useful on Raspberry Pi
# useful on Raspberry Pi boards with micro-controllers powered over # boards with micro-controllers powered over USB - it briefly
# USB - it briefly disables power to all USB ports to accomplish a # disables power to all USB ports to accomplish a micro-controller
# micro-controller reset. The 'command' method involves sending a # reset. The 'command' method involves sending a Klipper command to
# Klipper command to the micro-controller so that it can reset # the micro-controller so that it can reset itself. The default is
# itself. The default is 'arduino'. # 'arduino'.
# The printer section controls high level printer settings. # The printer section controls high level printer settings.
[printer] [printer]

View File

@ -272,11 +272,11 @@ def stk500v2_leave(ser, reactor):
# Attempt an arduino style reset on a serial port # Attempt an arduino style reset on a serial port
def arduino_reset(serialport, reactor): def arduino_reset(serialport, reactor):
# First try opening the port at 1200 baud # First try opening the port at a different baud
ser = serial.Serial(serialport, 1200, timeout=0) ser = serial.Serial(serialport, 2400, timeout=0)
ser.read(1) ser.read(1)
reactor.pause(reactor.monotonic() + 0.100) reactor.pause(reactor.monotonic() + 0.100)
# Then try toggling DTR # Then toggle DTR
ser.dtr = True ser.dtr = True
reactor.pause(reactor.monotonic() + 0.100) reactor.pause(reactor.monotonic() + 0.100)
ser.dtr = False ser.dtr = False