Skip to content

Commit 081bf13

Browse files
committed
split up lines, xonxoff on
1 parent 513a7d1 commit 081bf13

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

gcodeplotutils/sendgcode.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,16 @@ def sendHPGL(port, commands):
4242
s.write(commands)
4343
s.close()
4444

45-
def sendGcode(port, commands, speed=115200, quiet = False, gcodePause="@pause", plotter=None, variables={}, formulas={}):
45+
def sendGcode(port, commands, speed=115200, xonxoff=True, quiet = False, gcodePause="@pause", plotter=None, variables={}, formulas={}):
4646
class State(object):
4747
pass
4848

49+
commandsSplit = []
50+
for cmd in commands:
51+
commandsSplit += cmd.split("\n")
52+
53+
commands = commandsSplit
54+
4955
state = State()
5056
state.cmd = None
5157
state.done = False
@@ -58,7 +64,7 @@ class State(object):
5864
if port.startswith('file:'):
5965
s = FakeSerial(port[5:])
6066
else:
61-
s = Serial(port, 115200)
67+
s = Serial(port, speed, xonxoff=xonxoff)
6268
s.flushInput()
6369

6470
class State(object):

0 commit comments

Comments
 (0)