def _flash_finished(self, code):
Logger.log("Flash output contents:\r\n")
Logger.log(self._flash_output)
if code == 0:
self._flash_output.extend(b"Rebooting from flash mode...\n")
self._update_output()
try:
s = serial.Serial(self._port, 115200)
s.dtr = False
s.rts = True
time.sleep(0.1)
s.rts = False
time.sleep(0.1)
self._flash_output.extend(b"Done, you may now use the device.\n")
self._update_output()
except (OSError, serial.SerialException):
QMessageBox.critical(self, "Flashing Error", "Failed to reboot into working mode.")
elif code == -1:
QMessageBox.critical(self, "Flashing Error", "Failed to run script.\nCheck that path to python is correct.")
else:
QMessageBox.critical(self, "Flashing Error", "Failed to flash new firmware")
self.eraseButton.setEnabled(True)
self.flashButton.setEnabled(True)
self._flashing = False
评论列表
文章目录