Skip to content

Commit

Permalink
flterm.py: use serial_for_url
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Britton authored and sbourdeauducq committed Jun 26, 2015
1 parent 04c64eb commit a1e3fb1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tools/flterm.py
Expand Up @@ -117,7 +117,14 @@ def __init__(self, kernel_image, kernel_address):

def open(self, port, speed):
port = port if not port.isdigit() else int(port)
self.serial = serial.Serial(port, speed, timeout=0.25)
self.serial = serial.serial_for_url(
port,
baudrate=speed,
bytesize=8,
parity="N",
stopbits=1,
xonxoff=0,
timeout=0.25)
self.serial.flushOutput()
self.serial.flushInput()
self.serial.close() # in case port was not correctly closed
Expand Down

0 comments on commit a1e3fb1

Please sign in to comment.