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:
parent
cc20c85ad0
commit
6f0ee0387d
@ -739,6 +739,9 @@ class StcBaseProtocol:
|
|||||||
self.ser.timeout = 0.5
|
self.ser.timeout = 0.5
|
||||||
self.ser.interCharTimeout = 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="")
|
print("Waiting for MCU, please cycle power: ", end="")
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user