]> Pileus Git - ~andy/csm213a-hw/blobdiff - vis/device.py
Flush pending input data from device
[~andy/csm213a-hw] / vis / device.py
index ba4678709df6b8872c022b805e9f490b5c79171d..f1766f0f57726b6e9c9121ad70281973fbcc27fa 100644 (file)
@@ -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