diff options
author | Gerhard Sittig <gerhard.sittig@gmx.net> | 2020-07-28 17:38:45 +0200 |
---|---|---|
committer | Gerhard Sittig <gerhard.sittig@gmx.net> | 2020-08-30 07:23:58 +0200 |
commit | d25293e6e4bf8126223c885e2bdccde9118800e7 (patch) | |
tree | a6f19c975144669e4deb11d5ed655bbc06e3a409 /decoders | |
parent | 80c76d2092814d2cd7d0f9fc6ddd6c0c937106dc (diff) | |
download | libsigrokdecode-d25293e6e4bf8126223c885e2bdccde9118800e7.tar.gz libsigrokdecode-d25293e6e4bf8126223c885e2bdccde9118800e7.zip |
sle44xx: don't assume RESET at the start of the capture
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.
Diffstat (limited to 'decoders')
-rw-r--r-- | decoders/sle44xx/pd.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/decoders/sle44xx/pd.py b/decoders/sle44xx/pd.py index a53a1ea..f84bea6 100644 --- a/decoders/sle44xx/pd.py +++ b/decoders/sle44xx/pd.py @@ -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 = [] |