mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 15:29:02 +08:00
Update plugins/USBPrinting/AutoDetectBaudJob.py
Co-authored-by: StefanBruens <stefan.bruens@rwth-aachen.de>
This commit is contained in:
parent
e50df2c1a1
commit
50935fdeda
@ -71,7 +71,9 @@ class AutoDetectBaudJob(Job):
|
|||||||
timeout_time = time() + wait_response_timeout
|
timeout_time = time() + wait_response_timeout
|
||||||
|
|
||||||
while timeout_time > time():
|
while timeout_time > time():
|
||||||
# If baudrate is wrong, then readline() might never return, even with timeouts set. Using read_until with size limit seems to fix this.
|
# If baudrate is wrong, then readline() might never
|
||||||
|
# return, even with timeouts set. Using read_until
|
||||||
|
# with size limit seems to fix this.
|
||||||
line = serial.read_until(size = 100)
|
line = serial.read_until(size = 100)
|
||||||
if b"ok" in line and b"T:" in line:
|
if b"ok" in line and b"T:" in line:
|
||||||
successful_responses += 1
|
successful_responses += 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user