aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2017-10-12 21:21:49 -0400
committerKevin O'Connor <kevin@koconnor.net>2017-10-12 21:46:09 -0400
commite0f275cddf55fb1afd21bb66c22e3c2a25d8d247 (patch)
tree4b38b3c532a05ebd30c516bb935c4e10399be828
parent07a69df62f7a3470329a3ea0ba1e569ab0e9d0fe (diff)
downloadkutter-e0f275cddf55fb1afd21bb66c22e3c2a25d8d247.tar.gz
kutter-e0f275cddf55fb1afd21bb66c22e3c2a25d8d247.tar.xz
kutter-e0f275cddf55fb1afd21bb66c22e3c2a25d8d247.zip
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>
-rw-r--r--config/example.cfg14
-rw-r--r--klippy/serialhdl.py6
2 files changed, 10 insertions, 10 deletions
diff --git a/config/example.cfg b/config/example.cfg
index 2119b3c9..96bddafb 100644
--- a/config/example.cfg
+++ b/config/example.cfg
@@ -256,13 +256,13 @@ pin_map: arduino
#restart_method: arduino
# This controls the mechanism the host will use to reset the
# micro-controller. The choices are 'arduino', 'rpi_usb', and
-# 'command'. The 'arduino' method (toggle DTR; set baud to 1200) is
-# common on Arduino boards and clones. The 'rpi_usb' method is
-# useful on Raspberry Pi boards with micro-controllers powered over
-# USB - it briefly disables power to all USB ports to accomplish a
-# micro-controller reset. The 'command' method involves sending a
-# Klipper command to the micro-controller so that it can reset
-# itself. The default is 'arduino'.
+# 'command'. The 'arduino' method (toggle DTR) is common on Arduino
+# boards and clones. The 'rpi_usb' method is useful on Raspberry Pi
+# boards with micro-controllers powered over USB - it briefly
+# disables power to all USB ports to accomplish a micro-controller
+# reset. The 'command' method involves sending a Klipper command to
+# the micro-controller so that it can reset itself. The default is
+# 'arduino'.
# The printer section controls high level printer settings.
[printer]
diff --git a/klippy/serialhdl.py b/klippy/serialhdl.py
index 8d6d6a7f..e7e35bf8 100644
--- a/klippy/serialhdl.py
+++ b/klippy/serialhdl.py
@@ -272,11 +272,11 @@ def stk500v2_leave(ser, reactor):
# Attempt an arduino style reset on a serial port
def arduino_reset(serialport, reactor):
- # First try opening the port at 1200 baud
- ser = serial.Serial(serialport, 1200, timeout=0)
+ # First try opening the port at a different baud
+ ser = serial.Serial(serialport, 2400, timeout=0)
ser.read(1)
reactor.pause(reactor.monotonic() + 0.100)
- # Then try toggling DTR
+ # Then toggle DTR
ser.dtr = True
reactor.pause(reactor.monotonic() + 0.100)
ser.dtr = False