summaryrefslogtreecommitdiff
path: root/decoders
diff options
context:
space:
mode:
authorBenediktO <benedikt_o@web.de>2020-07-27 08:31:31 +0200
committerGerhard Sittig <gerhard.sittig@gmx.net>2020-08-30 10:23:43 +0200
commit85f616edfa157ae6ed8ea9ea4a72b930816e4dc9 (patch)
treed912c8c7a7606866a700ca669c2b3c8d31c48962 /decoders
parentf759507a3ab0f774716fdaedc8a1580017309f47 (diff)
downloadlibsigrokdecode-85f616edfa157ae6ed8ea9ea4a72b930816e4dc9.tar.gz
libsigrokdecode-85f616edfa157ae6ed8ea9ea4a72b930816e4dc9.zip
ir_nec: Annotate IR frame already at the end of the STOP bit
Emit annotations for the current IR frame as soon as possible, at the very end of the STOP bit. Don't defer annotation emission until the start of the next frame is seen. This unbreaks captures where the last IR frame would not decode before. [ gsi: rephrased commit message, updated comment in the implementation ]
Diffstat (limited to 'decoders')
-rw-r--r--decoders/ir_nec/pd.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/decoders/ir_nec/pd.py b/decoders/ir_nec/pd.py
index 0c4987f..05c8c00 100644
--- a/decoders/ir_nec/pd.py
+++ b/decoders/ir_nec/pd.py
@@ -228,9 +228,12 @@ class Decoder(srd.Decoder):
(self.ir,) = self.wait({Pin.IR: 'e'})
if self.ir != active:
- # Save the non-active edge, then wait for the next edge.
+ # Save the location of the non-active edge (recessive),
+ # then wait for the next edge. Immediately process the
+ # end of the STOP bit which completes an IR frame.
self.ss_other_edge = self.samplenum
- continue
+ if self.state != 'STOP':
+ continue
# Reset internal state for long periods of idle level.
width = self.samplenum - self.ss_bit