diff --git a/DLPilot/src/app_gui.py b/DLPilot/src/app_gui.py index c3f8f49..e8dc28e 100644 --- a/DLPilot/src/app_gui.py +++ b/DLPilot/src/app_gui.py @@ -34,7 +34,7 @@ BOLD = ('Microsoft YaHei UI', 13, 'bold') TITLE_FONT = ('Microsoft YaHei UI', 18, 'bold') APP_NAME = 'DLPilot' -APP_VERSION = '0.3.2' +APP_VERSION = '0.3.3' REPO_URL = 'https://gitea.hulk.wang/hulk/LT8619C_Debug_Tools' diff --git a/DLPilot/src/dlpc_rs485.py b/DLPilot/src/dlpc_rs485.py index 5b7d90f..e369f14 100644 --- a/DLPilot/src/dlpc_rs485.py +++ b/DLPilot/src/dlpc_rs485.py @@ -279,7 +279,12 @@ class DLPC485: self.on_event(f'← {describe(fr)} ' f'[{fr.raw.hex(" ").upper()}]') except OSError: + try: + self.ser.close() + except Exception: + pass self.ser = None + self._open_key = None # 必须同步清除, 否则同参数重连被当作已打开而跳过 with self._lock: self._target = None self.on_status('串口丢失(设备拔出?), 请重新连接')