From 13c484ddd3156c70bb1257208bdae839e463a24e Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Fri, 5 May 2017 08:11:32 +0200 Subject: microwire: Shorten decode() a bit. --- decoders/microwire/pd.py | 6 ++---- 1 file 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, -- cgit v1.2.3-70-g09d2