mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 15:39:14 +08:00
Remove redundant variable
This commit is contained in:
parent
ecf32a261e
commit
27eb72c64a
@ -62,7 +62,6 @@ class AutoDetectBaudJob(Job):
|
||||
except ValueError:
|
||||
continue
|
||||
sleep(wait_bootloader) # Ensure that we are not talking to the boot loader. 1.5 seconds seems to be the magic number
|
||||
successful_responses = 0
|
||||
|
||||
serial.write(b"\n") # Ensure we clear out previous responses
|
||||
serial.write(b"M105\n")
|
||||
@ -73,13 +72,11 @@ class AutoDetectBaudJob(Job):
|
||||
while timeout_time > time():
|
||||
line = serial.readline()
|
||||
if b"ok" in line and b"T:" in line:
|
||||
successful_responses += 1
|
||||
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))
|
||||
serial.close() # close serial port so it can be opened by the USBPrinterOutputDevice
|
||||
return
|
||||
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))
|
||||
serial.close() # close serial port so it can be opened by the USBPrinterOutputDevice
|
||||
return
|
||||
|
||||
serial.write(b"M105\n")
|
||||
sleep(15) # Give the printer some time to init and try again.
|
||||
|
Loading…
x
Reference in New Issue
Block a user