From: Andy Spencer Date: Mon, 3 Feb 2014 08:02:52 +0000 (+0000) Subject: Flush pending input data from device X-Git-Url: http://pileus.org/git/?p=~andy%2Fcsm213a-hw;a=commitdiff_plain;h=d935bc71aa4996966412289d3d8616102b684be6 Flush pending input data from device --- diff --git a/vis/device.py b/vis/device.py index ba46787..f1766f0 100644 --- a/vis/device.py +++ b/vis/device.py @@ -32,6 +32,7 @@ class Device: bytesize = self.config.databits, \ stopbits = self.config.stopbits, \ timeout = 0) + self.serial.flushInput() except Exception as ex: return str(ex) @@ -69,7 +70,7 @@ class Device: else: self.inbuf.append(char) if count > limit: - print("Eror: exceeded read limit") + print("Error: exceeded read limit") break count += 1 return items