diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2018-09-11 21:44:40 +0200 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2018-09-11 23:44:21 +0200 |
commit | 3d188680d3937eebe9e03ce79d9bbb297426237c (patch) | |
tree | b6541606f4af5a3c35ab24dbc401a4241392ea04 | |
parent | 80b6feeb73048dffabeba7f8c5d20bfaf3dcb840 (diff) | |
download | libsigrokdecode-3d188680d3937eebe9e03ce79d9bbb297426237c.tar.gz libsigrokdecode-3d188680d3937eebe9e03ce79d9bbb297426237c.zip |
ook_vis: Minor code simplifications.
-rw-r--r-- | decoders/ook_vis/pd.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/decoders/ook_vis/pd.py b/decoders/ook_vis/pd.py index 9bbd37f..3785331 100644 --- a/decoders/ook_vis/pd.py +++ b/decoders/ook_vis/pd.py @@ -113,8 +113,7 @@ class Decoder(srd.Decoder): if len(ook) >= preamble_end: preamble_end += int(self.sync_offset) - 1 - self.ss = ook[0][0] - self.es = ook[preamble_end][1] + self.ss, self.es = ook[0][0], ook[preamble_end][1] self.putx([line, ['Preamble', 'Pre', 'P']]) self.decode_pos += preamble_end @@ -149,10 +148,7 @@ class Decoder(srd.Decoder): ook = self.decoded for i in range(len(ook)): self.ookstring += ook[i][2] - if 'Nibble' in self.displayas: - bits = 4 - else: - bits = 8 + bits = 4 if 'Nibble' in self.displayas else 8 rem_nibbles = len(self.ookstring) // bits for i in range(rem_nibbles): # Display the rest of the nibbles. self.ss = ook[self.decode_pos][0] |