mcu: Disable waiting in send_wait_ack() if in debugging mode

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2025-08-22 16:53:34 -04:00
parent 159b71e51e
commit 3aadda6fb3
2 changed files with 6 additions and 7 deletions

View File

@@ -84,7 +84,7 @@ class CommandQueryWrapper:
# Wrapper around command sending
class CommandWrapper:
def __init__(self, serial, msgformat, cmd_queue=None):
def __init__(self, serial, msgformat, cmd_queue=None, debugoutput=False):
self._serial = serial
msgparser = serial.get_msgparser()
self._cmd = msgparser.lookup_command(msgformat)
@@ -92,6 +92,9 @@ class CommandWrapper:
cmd_queue = serial.get_default_command_queue()
self._cmd_queue = cmd_queue
self._msgtag = msgparser.lookup_msgid(msgformat) & 0xffffffff
if debugoutput:
# Can't use send_wait_ack when in debugging mode
self.send_wait_ack = self.send
def send(self, data=(), minclock=0, reqclock=0):
cmd = self._cmd.encode(data)
self._serial.raw_send(cmd, minclock, reqclock, self._cmd_queue)
@@ -888,7 +891,8 @@ class MCU:
def alloc_command_queue(self):
return self._serial.alloc_command_queue()
def lookup_command(self, msgformat, cq=None):
return CommandWrapper(self._serial, msgformat, cq)
return CommandWrapper(self._serial, msgformat, cq,
debugoutput=self.is_fileoutput())
def lookup_query_command(self, msgformat, respformat, oid=None,
cq=None, is_async=False):
return CommandQueryWrapper(self._serial, msgformat, respformat, oid,