aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/serialhdl.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2016-12-09 19:04:30 -0500
committerKevin O'Connor <kevin@koconnor.net>2016-12-09 19:07:03 -0500
commit74fa8a3907359a7c7e9159601b8a8c2c6b79e960 (patch)
tree2acb67d85e9a29891f440d5d05e06fdc958b4def /klippy/serialhdl.py
parentcad1e0b985299ff1b3210a2b9cdfbaac7d5b2c51 (diff)
downloadkutter-74fa8a3907359a7c7e9159601b8a8c2c6b79e960.tar.gz
kutter-74fa8a3907359a7c7e9159601b8a8c2c6b79e960.tar.xz
kutter-74fa8a3907359a7c7e9159601b8a8c2c6b79e960.zip
serialhdl: Clear "hupcl" bit from serial port
The arduino style serial port interfaces can reset the MCU when the serial port is opened. Clearing the HUPCL flag makes this less likely. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/serialhdl.py')
-rw-r--r--klippy/serialhdl.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/klippy/serialhdl.py b/klippy/serialhdl.py
index 7120c43c..2a539cf1 100644
--- a/klippy/serialhdl.py
+++ b/klippy/serialhdl.py
@@ -6,7 +6,7 @@
import time, logging, threading
import serial
-import msgproto, chelper
+import msgproto, chelper, util
class SerialReader:
BITS_PER_BYTE = 10.
@@ -298,6 +298,7 @@ class SerialBootStrap:
# Attempt to place an AVR stk500v2 style programmer into normal mode
def stk500v2_leave(ser, reactor):
logging.debug("Starting stk500v2 leave programmer sequence")
+ util.clear_hupcl(ser.fileno())
origbaud = ser.baudrate
# Request a dummy speed first as this seems to help reset the port
ser.baudrate = 2400