mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Added missing close for USB programmer. Thanks to legoabram for the fix
This commit is contained in:
parent
f82aecb7ca
commit
f5590a98ed
1 changed files with 3 additions and 0 deletions
|
@ -202,6 +202,7 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
|
|||
try:
|
||||
programmer.connect(self._serial_port)
|
||||
except Exception:
|
||||
programmer.close()
|
||||
pass
|
||||
|
||||
# Give programmer some time to connect. Might need more in some cases, but this worked in all tested cases.
|
||||
|
@ -312,8 +313,10 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
|
|||
programmer.connect(self._serial_port) # Connect with the serial, if this succeeds, it's an arduino based usb device.
|
||||
self._serial = programmer.leaveISP()
|
||||
except ispBase.IspError as e:
|
||||
programmer.close()
|
||||
Logger.log("i", "Could not establish connection on %s: %s. Device is not arduino based." %(self._serial_port,str(e)))
|
||||
except Exception as e:
|
||||
programmer.close()
|
||||
Logger.log("i", "Could not establish connection on %s, unknown reasons. Device is not arduino based." % self._serial_port)
|
||||
|
||||
# If the programmer connected, we know its an atmega based version.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue