From: daid Date: Fri, 28 Nov 2014 11:14:29 +0000 (+0100) Subject: Some firmware programming improvements in the error handling. X-Git-Tag: 14.12-RC9~3 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=209cc73817b1675992d29c6635618c5295e819f5;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 8a2972e0..2ee983f2 100644 --- a/Cura/gui/firmwareInstall.py +++ b/Cura/gui/firmwareInstall.py @@ -108,7 +108,7 @@ class InstallFirmware(wx.Dialog): programmer.connect(self.port) break except ispBase.IspError: - pass + programmer.close() time.sleep(1) if not self: #Window destroyed @@ -117,7 +117,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?"),