diff options
Diffstat (limited to 'decoders/seven_segment')
-rw-r--r-- | decoders/seven_segment/pd.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/decoders/seven_segment/pd.py b/decoders/seven_segment/pd.py index 87714bb..eedacf9 100644 --- a/decoders/seven_segment/pd.py +++ b/decoders/seven_segment/pd.py @@ -67,6 +67,8 @@ class Decoder(srd.Decoder): options = ( {'id': 'polarity', 'desc': 'Expected polarity', 'default': 'common-cathode', 'values': ('common-cathode', 'common-anode')}, + {'id': 'show_unknown', 'desc': 'Display Unknown characters as #', + 'default': 'no', 'values': ('yes', 'no')}, ) annotations = ( ('decoded-digit', 'Decoded digit'), @@ -120,6 +122,9 @@ class Decoder(srd.Decoder): # Convert to character string. digit = self.pins_to_hex(oldpins[:7]) + if digit is None and self.options['show_unknown'] == 'yes': + digit = '#' + if digit is not None: dp = oldpins[7] |