From ddb795bcccf607a761d350c9bf1ea381b29b88fe Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sun, 28 Feb 2021 17:15:29 -0500 Subject: [PATCH] logextract: Improve handling of TMC UART read/write register commands Signed-off-by: Kevin O'Connor --- scripts/logextract.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/logextract.py b/scripts/logextract.py index 85632d2a..5d86cdce 100755 --- a/scripts/logextract.py +++ b/scripts/logextract.py @@ -130,7 +130,9 @@ class TMCUartHelper: def pretty_print(self, addr, reg, val=None): if val is None: 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): data = bytearray(msg) if len(data) == 10: