]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/ir_rc5/pd.py
ir_rc5: Change PD options to be a tuple of dictionaries.
[libsigrokdecode.git] / decoders / ir_rc5 / pd.py
index cd94eae1159a59d816bb940622017e023e5d3d23..a42c86f59edda37171dcb69c71c3d8c3e5e41520 100644 (file)
@@ -34,10 +34,12 @@ class Decoder(srd.Decoder):
         {'id': 'ir', 'name': 'IR', 'desc': 'IR data line'},
     ]
     optional_probes = []
-    options = {
-        'polarity': ['Polarity', 'active-low'],
-        'protocol': ['Protocol type', 'standard'],
-    }
+    options = (
+        {'id': 'polarity', 'desc': 'Polarity', 'default': 'active-low',
+            'values': ('active-low', 'active-high')},
+        {'id': 'protocol', 'desc': 'Protocol type', 'default': 'standard',
+            'values': ('standard', 'extended')},
+    )
     annotations = [
         ['bit', 'Bit'],
         ['startbit1', 'Startbit 1'],
@@ -174,7 +176,7 @@ class Decoder(srd.Decoder):
             if bit != None:
                 self.bits.append([self.samplenum, bit])
 
-            if len(self.bits) == 14 + 1:
+            if len(self.bits) == 14:
                 self.handle_bits()
                 self.reset_decoder_state()