diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2017-05-05 08:11:32 +0200 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2017-05-05 19:19:26 +0200 |
commit | 13c484ddd3156c70bb1257208bdae839e463a24e (patch) | |
tree | 3b3ecd6a7e680bc1cc6458dba7c2a608671bbf7e | |
parent | 0e081655c049245c2215ed5fb14bcecdf57ca9df (diff) | |
download | libsigrokdecode-13c484ddd3156c70bb1257208bdae839e463a24e.tar.gz libsigrokdecode-13c484ddd3156c70bb1257208bdae839e463a24e.zip |
microwire: Shorten decode() a bit.
-rw-r--r-- | decoders/microwire/pd.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/decoders/microwire/pd.py b/decoders/microwire/pd.py index acda96b..e64732d 100644 --- a/decoders/microwire/pd.py +++ b/decoders/microwire/pd.py @@ -89,10 +89,8 @@ class Decoder(srd.Decoder): packet.append({'samplenum': self.samplenum, 'matched': self.matched, 'cs': cs, 'sk': sk, 'si': si, 'so': so}) - if sk == 0: - cs, sk, si, so = self.wait([{0: 'l'}, {1: 'r'}, {3: 'e'}]) - else: - cs, sk, si, so = self.wait([{0: 'l'}, {1: 'f'}, {3: 'e'}]) + edge = 'r' if sk == 0 else 'f' + cs, sk, si, so = self.wait([{0: 'l'}, {1: edge}, {3: 'e'}]) # Save last change. packet.append({'samplenum': self.samplenum, 'matched': self.matched, |