fix(DLPilot): 串口卡死与序列互相干扰修复

This commit is contained in:
2026-09-18 01:08:51 +08:00
parent 2b7d103312
commit c8ea5be031
3 changed files with 24 additions and 1 deletions
+3 -1
View File
@@ -290,7 +290,9 @@ class DLPC485:
port, baud, bytesize=bytesizes.get(dbsize, serial.EIGHTBITS),
parity=parities.get(parity, serial.PARITY_NONE),
stopbits=stopbits.get(sbits, serial.STOPBITS_ONE),
timeout=0.15)
timeout=0.15,
write_timeout=1.0) # 写超时: 转换器停滞时 write 会
# 永久阻塞并卡死线程, 必须设上限
self.parser = FrameParser()
self._open_key = target
self.on_status(f'已连接 {port} @ {baud} '