fix rts/dtr

This commit is contained in:
vc4
2025-10-01 11:57:58 +08:00
parent 18ff4971ec
commit 0c57edf52a

View File

@@ -173,8 +173,8 @@ class UIProcessor:
self.ckbtn_shex.var.set(1 if hex_flag else 0) self.ckbtn_shex.var.set(1 if hex_flag else 0)
self.wait_send_data.update({ self.wait_send_data.update({
'rts': rts if rts is not None else self.wait_send_data['rts'], 'rts': rts,
'dtr': dtr if dtr is not None else self.wait_send_data['dtr'] 'dtr': dtr
}) })
def get_send_data(self, cache: bool = True) -> Dict[str, Any]: def get_send_data(self, cache: bool = True) -> Dict[str, Any]:
@@ -204,7 +204,6 @@ class UIProcessor:
except Exception as e: except Exception as e:
logger.error(f"处理发送数据时出错: {e}") logger.error(f"处理发送数据时出错: {e}")
self.wait_send_data['text'] = b'' self.wait_send_data['text'] = b''
return self.wait_send_data return self.wait_send_data
def dmesg(self, category: str, data: bytes): def dmesg(self, category: str, data: bytes):
@@ -530,6 +529,8 @@ class SerialCommunicator:
# 设置数据准备事件,唤醒发送线程 # 设置数据准备事件,唤醒发送线程
self.data_ready.set() self.data_ready.set()
# 手动发送时不操作dtr/rts
self.ui.set_send_data(rts=None, dtr=None)
def _send_data(self): def _send_data(self):
"""实际发送数据""" """实际发送数据"""