]> sigrok.org Git - libsigrokdecode.git/commitdiff
sle44xx: don't assume RESET at the start of the capture
authorGerhard Sittig <redacted>
Tue, 28 Jul 2020 15:38:45 +0000 (17:38 +0200)
committerGerhard Sittig <redacted>
Sun, 30 Aug 2020 05:23:58 +0000 (07:23 +0200)
The decoder cannot know the state of the input signal before the start
of the capture. Assuming the RESET state results in incorrect output for
data bits which we don't know the context of. Start from unknown state
instead until a reliable condition is seen to synchronize to.

decoders/sle44xx/pd.py

index a53a1ea18ebc9f543ec4429536e5664450ec0653..f84bea65efd4d52608417a2b82f778b718c1d797 100644 (file)
@@ -83,7 +83,7 @@ class Decoder(srd.Decoder):
     def reset(self):
         self.ss = self.es = self.ss_byte = -1
         self.bits = []
-        self.cmd = 'RESET'
+        self.cmd = None
 
     def metadata(self, key, value):
         if key == srd.SRD_CONF_SAMPLERATE:
@@ -153,7 +153,8 @@ class Decoder(srd.Decoder):
             self.put(bit_ss, bit_es, self.out_ann, [cls, texts])
 
         cls, texts = lookup_proto_ann_txt(self.cmd, {'data': databyte})
-        self.putx([cls, texts])
+        if cls:
+            self.putx([cls, texts])
 
         # Done with this packet.
         self.bits = []