From d991d574473f1ed6772bc28af0d362f5e675f1b5 Mon Sep 17 00:00:00 2001 From: hulk Date: Thu, 17 Sep 2026 10:17:52 +0800 Subject: [PATCH] =?UTF-8?q?fix(DLPilot):=20=E4=B8=B2=E5=8F=A3=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E6=8B=94=E5=87=BA=E5=90=8E=E5=90=8C=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=87=8D=E8=BF=9E=E6=97=A0=E5=93=8D=E5=BA=94(=E6=8E=89?= =?UTF-8?q?=E7=BA=BF=E5=88=86=E6=94=AF=E5=90=8C=E6=AD=A5=E6=B8=85=20=5Fope?= =?UTF-8?q?n=5Fkey);=20=E7=89=88=E6=9C=AC=200.3.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DLPilot/src/app_gui.py | 2 +- DLPilot/src/dlpc_rs485.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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('串口丢失(设备拔出?), 请重新连接')