logextract: Improve handling of TMC UART read/write register commands

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2021-02-28 17:15:29 -05:00
parent c9b81e698e
commit ddb795bccc
1 changed files with 3 additions and 1 deletions

View File

@ -130,7 +130,9 @@ class TMCUartHelper:
def pretty_print(self, addr, reg, val=None): def pretty_print(self, addr, reg, val=None):
if val is None: if val is None:
return "(%x@%x)" % (reg, addr) return "(%x@%x)" % (reg, addr)
return "(%x@%x=%08x)" % (reg, addr, val) if reg & 0x80:
return "(%x@%x=%08x)" % (reg & ~0x80, addr, val)
return "(%x@%x==%08x)" % (reg, addr, val)
def parse_msg(self, msg): def parse_msg(self, msg):
data = bytearray(msg) data = bytearray(msg)
if len(data) == 10: if len(data) == 10: