From: daid Date: Fri, 28 Nov 2014 11:14:29 +0000 (+0100) Subject: Some firmware programming improvements in the error handling. X-Git-Tag: lulzbot-14.12~12 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=190699141f230e7cd4a6c194eef69f1a9ebd377f;p=cura.git Some firmware programming improvements in the error handling. --- diff --git a/Cura/avr_isp/stk500v2.py b/Cura/avr_isp/stk500v2.py index 62fd1726..27e679f1 100644 --- a/Cura/avr_isp/stk500v2.py +++ b/Cura/avr_isp/stk500v2.py @@ -7,6 +7,7 @@ import os, struct, sys, time from serial import Serial from serial import SerialException +from serial import SerialTimeoutException import ispBase, intelHex @@ -133,7 +134,7 @@ class Stk500v2(ispBase.IspBase): try: self.serial.write(message) self.serial.flush() - except Serial.SerialTimeoutException: + except SerialTimeoutException: raise ispBase.IspError('Serial send timeout') self.seq = (self.seq + 1) & 0xFF return self.recvMessage() diff --git a/Cura/gui/firmwareInstall.py b/Cura/gui/firmwareInstall.py index 1dc9844b..4dd751e7 100644 --- a/Cura/gui/firmwareInstall.py +++ b/Cura/gui/firmwareInstall.py @@ -110,7 +110,7 @@ class InstallFirmware(wx.Dialog): programmer.connect(self.port) break except ispBase.IspError: - pass + programmer.close() time.sleep(1) if not self: #Window destroyed @@ -119,7 +119,7 @@ class InstallFirmware(wx.Dialog): try: programmer.connect(self.port) except ispBase.IspError: - pass + programmer.close() if not programmer.isConnected(): wx.MessageBox(_("Failed to find machine for firmware upgrade\nIs your machine connected to the PC?"),