summaryrefslogtreecommitdiff
path: root/decoders/jtag/jtag.py
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2012-05-03 01:39:30 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2012-05-03 01:41:02 +0200
commit8189738ed4ab7947a7b4a867bcde100cd84f44a7 (patch)
tree78d59cca0f6b4db92ebfa9623f6bea8c49885f7a /decoders/jtag/jtag.py
parente9656a0c6b99528656df8d18cd84643eb9491d63 (diff)
downloadlibsigrokdecode-8189738ed4ab7947a7b4a867bcde100cd84f44a7.tar.gz
libsigrokdecode-8189738ed4ab7947a7b4a867bcde100cd84f44a7.zip
srd: JTAG: Also show the bitstrings in hex (for now).
Diffstat (limited to 'decoders/jtag/jtag.py')
-rw-r--r--decoders/jtag/jtag.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/decoders/jtag/jtag.py b/decoders/jtag/jtag.py
index 197d5a6..df16d2b 100644
--- a/decoders/jtag/jtag.py
+++ b/decoders/jtag/jtag.py
@@ -133,14 +133,16 @@ class Decoder(srd.Decoder):
t = self.state[-2:] + ' TDI'
b = ''.join(map(str, self.bits_tdi))
- s = t + ': ' + b + ', ' + str(len(self.bits_tdi)) + ' bits'
+ h = ' (0x%x' % int('0b' + b, 2) + ')'
+ s = t + ': ' + b + h + ', ' + str(len(self.bits_tdi)) + ' bits'
self.put(self.ss, self.es, self.out_ann, [0, [s]])
self.put(self.ss, self.es, self.out_proto, [t, b])
self.bits_tdi = []
t = self.state[-2:] + ' TDO'
b = ''.join(map(str, self.bits_tdo))
- s = t + ': ' + b + ', ' + str(len(self.bits_tdo)) + ' bits'
+ h = ' (0x%x' % int('0b' + b, 2) + ')'
+ s = t + ': ' + b + h + ', ' + str(len(self.bits_tdo)) + ' bits'
self.put(self.ss, self.es, self.out_ann, [0, [s]])
self.put(self.ss, self.es, self.out_proto, [t, b])
self.bits_tdo = []