diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2019-11-09 15:48:36 +0100 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2019-11-09 15:48:36 +0100 |
commit | dcab210499527b4e9b5d41ebfa6852ca9e9e9df5 (patch) | |
tree | 5943628db627ef92ac59e703512d77624215f606 /decoders/eeprom93xx/pd.py | |
parent | 841cb8c0ea257b79690b0f2467ad6df7bb09cb29 (diff) | |
download | libsigrokdecode-dcab210499527b4e9b5d41ebfa6852ca9e9e9df5.tar.gz libsigrokdecode-dcab210499527b4e9b5d41ebfa6852ca9e9e9df5.zip |
eeprom93xx: Use fixed-width hex output.
This improves readability a bit in most cases.
Diffstat (limited to 'decoders/eeprom93xx/pd.py')
-rw-r--r-- | decoders/eeprom93xx/pd.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/decoders/eeprom93xx/pd.py b/decoders/eeprom93xx/pd.py index db4dd3f..8c08fc8 100644 --- a/decoders/eeprom93xx/pd.py +++ b/decoders/eeprom93xx/pd.py @@ -67,7 +67,7 @@ class Decoder(srd.Decoder): for b in range(len(data)): a += (data[b].si << (len(data) - b - 1)) self.put(data[0].ss, data[-1].es, self.out_ann, - [0, ['Address: 0x%x' % a, 'Addr: 0x%x' % a, '0x%x' % a]]) + [0, ['Address: 0x%04x' % a, 'Addr: 0x%04x' % a, '0x%04x' % a]]) self.put(data[0].ss, data[-1].es, self.out_binary, [0, bytes([a])]) def put_word(self, si, data): @@ -90,7 +90,7 @@ class Decoder(srd.Decoder): self.out_ann, [idx, ['Data: %s' % word_str, '%s' % word_str]]) else: self.put(data[0].ss, data[-1].es, - self.out_ann, [idx, ['Data: 0x%x' % word, '0x%x' % word]]) + self.out_ann, [idx, ['Data: 0x%04x' % word, '0x%04x' % word]]) self.put(data[0].ss, data[-1].es, self.out_binary, [1, bytes([(word & 0xff00) >> 8, word & 0xff])]) |