summaryrefslogtreecommitdiff
path: root/decoders/seven_segment/pd.py
diff options
context:
space:
mode:
Diffstat (limited to 'decoders/seven_segment/pd.py')
-rw-r--r--decoders/seven_segment/pd.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/decoders/seven_segment/pd.py b/decoders/seven_segment/pd.py
index 26d1d83..87714bb 100644
--- a/decoders/seven_segment/pd.py
+++ b/decoders/seven_segment/pd.py
@@ -88,10 +88,7 @@ class Decoder(srd.Decoder):
self.put(ss_block, es_block, self.out_ann, data)
def pins_to_hex(self, pins):
- if pins in digits:
- return digits[pins]
- else:
- return None
+ return digits.get(pins, None)
def decode(self):
oldpins = self.wait()
@@ -127,9 +124,8 @@ class Decoder(srd.Decoder):
dp = oldpins[7]
# Check if decimal point is present and active.
- if self.have_dp:
- if dp == 1:
- digit = digit + '.'
+ if self.have_dp and dp == 1:
+ digit += '.'
self.putb(lastpos, self.samplenum, [0, [digit]])