]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/counter/pd.py
decoders: Various cosmetic/consistency/typo fixes.
[libsigrokdecode.git] / decoders / counter / pd.py
index 27a2be88dc07934f9eed9a33a90ddc121c5d7c70..f1134bd14f61cb3b6bba3049608992baf249bc89 100644 (file)
@@ -27,10 +27,11 @@ class Decoder(srd.Decoder):
     id = 'counter'
     name = 'Counter'
     longname = 'Edge counter'
-    desc = 'Count number of edges.'
+    desc = 'Count the number of edges in a signal.'
     license = 'gplv2+'
     inputs = ['logic']
     outputs = []
+    tags = ['Util']
     channels = (
         {'id': 'data', 'name': 'Data', 'desc': 'Data line'},
     )
@@ -137,7 +138,8 @@ class Decoder(srd.Decoder):
             self.putc(ROW_EDGE, edge_start, ["{:d}".format(edge_count)])
             edge_start = now
 
-            if divider and (edge_count % divider) == 0:
+            word_edge_count = edge_count - int(self.options['edge_off'])
+            if divider and (word_edge_count % divider) == 0:
                 word_count += 1
                 self.putc(ROW_WORD, word_start, ["{:d}".format(word_count)])
                 word_start = now