Merge pull request #4825 from Frischid/patch-2

Update AutoDetectBaudJob.py
This commit is contained in:
Diego Prado Gesto 2019-02-01 11:31:02 +01:00 committed by GitHub
commit f7ffb3ae69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -72,9 +72,9 @@ class AutoDetectBaudJob(Job):
while timeout_time > time():
line = serial.readline()
if b"ok " in line and b"T:" in line:
if b"ok" in line and b"T:" in line:
successful_responses += 1
if successful_responses >= 3:
if successful_responses >= 1:
self.setResult(baud_rate)
Logger.log("d", "Detected baud rate {baud_rate} on serial {serial} on retry {retry} with after {time_elapsed:0.2f} seconds.".format(
serial = self._serial_port, baud_rate = baud_rate, retry = retry, time_elapsed = time() - start_timeout_time))