Set the start and end samplenum for the warnings so they are visible and
correctly placed in PulseView.
---
 decoders/lpc/pd.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/decoders/lpc/pd.py b/decoders/lpc/pd.py
index 9e73b0d..1d0200b 100644
--- a/decoders/lpc/pd.py
+++ b/decoders/lpc/pd.py
@@ -157,7 +157,9 @@ def start(self):
         self.out_ann = self.register(srd.OUTPUT_ANN)
 
     def putb(self, data):
-        self.put(self.ss_block, self.es_block, self.out_ann, data)
+        # use current sample number for end of warning
+        es = self.samplenum if data[0] == 0 else self.es_block
+        self.put(self.ss_block, es, self.out_ann, data)
 
     def handle_get_start(self):
         # LAD[3:0]: START field (1 clock cycle).
@@ -237,8 +239,6 @@ def handle_get_tar(self):
 
         self.es_block = self.samplenum
         self.putb([4, ['TAR, cycle %d: %s' % (self.tarcount, self.lad_bits)]])
-        self.ss_block = self.samplenum
-
         # On the first TAR clock cycle LAD[3:0] is driven to 1111 by
         # either the host or peripheral. On the second clock cycle,
         # the host or peripheral tri-states LAD[3:0], but its value
@@ -247,6 +247,7 @@ def handle_get_tar(self):
             self.putb([0, ['TAR, cycle %d: %s (expected 1111)' % \
                            (self.tarcount, self.lad_bits)]])
 
+        self.ss_block = self.samplenum
         if (self.tarcount != 1):
             self.tarcount += 1
             return
@@ -307,8 +308,6 @@ def handle_get_tar2(self):
 
         self.es_block = self.samplenum
         self.putb([7, ['TAR, cycle %d: %s' % (self.tarcount, self.lad_bits)]])
-        self.ss_block = self.samplenum
-
         # On the first TAR clock cycle LAD[3:0] is driven to 1111 by
         # either the host or peripheral. On the second clock cycle,
         # the host or peripheral tri-states LAD[3:0], but its value
@@ -317,6 +316,7 @@ def handle_get_tar2(self):
             self.putb([0, ['Warning: TAR, cycle %d: %s (expected 1111)'
                            % (self.tarcount, self.lad_bits)]])
 
+        self.ss_block = self.samplenum
         if (self.tarcount != 1):
             self.tarcount += 1
             return
-- 
2.30.2


_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to