serial: flush input on connect

Sometimes there's some garbage in the input buffer and we aren't
interested in that.
This commit is contained in:
Grigori Goronzy 2015-12-11 01:21:06 +01:00
parent cc20c85ad0
commit 6f0ee0387d

View File

@ -739,6 +739,9 @@ class StcBaseProtocol:
self.ser.timeout = 0.5
self.ser.interCharTimeout = 0.5
# avoid glitches if there is something in the input buffer
self.ser.flushInput()
print("Waiting for MCU, please cycle power: ", end="")
sys.stdout.flush()