]> sigrok.org Git - libsigrokdecode.git/commitdiff
ir_nec: fix #1243, multiple capture frames.
authorPhilipp Marek <redacted>
Wed, 4 Jul 2018 12:41:17 +0000 (14:41 +0200)
committerUwe Hermann <redacted>
Fri, 29 Nov 2019 21:01:56 +0000 (22:01 +0100)
decoders/ir_nec/pd.py

index bb52420fc19baf4662c74e5f720735f1bed7d503..096ffc95a41428b9246f19899f5b96e799ce178f 100644 (file)
@@ -111,7 +111,6 @@ class Decoder(srd.Decoder):
 
     def start(self):
         self.out_ann = self.register(srd.OUTPUT_ANN)
-        self.active = 0 if self.options['polarity'] == 'active-low' else 1
 
     def metadata(self, key, value):
         if key == srd.SRD_CONF_SAMPLERATE:
@@ -164,7 +163,9 @@ class Decoder(srd.Decoder):
         cd_count = None
         if self.options['cd_freq']:
             cd_count = int(self.samplerate / self.options['cd_freq']) + 1
-            prev_ir = None
+        prev_ir = None
+
+        self.active = 0 if self.options['polarity'] == 'active-low' else 1
 
         while True:
             # Detect changes in the presence of an active input signal.