]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/graycode/pd.py
decoders: Various cosmetic/consistency/typo fixes.
[libsigrokdecode.git] / decoders / graycode / pd.py
index 1211c69efd88834a47cd84120cf287be5c6d4f4e..63014a29dd6366aa44db9221bef11c749ca07751 100644 (file)
@@ -77,10 +77,11 @@ class Decoder(srd.Decoder):
     id = 'graycode'
     name = 'Gray code'
     longname = 'Gray code and rotary encoder'
-    desc = 'Accumulate rotary encoder increments, provide timing statistics.'
+    desc = 'Accumulate rotary encoder increments, provide statistics.'
     license = 'gplv2+'
     inputs = ['logic']
     outputs = ['graycode']
+    tags = ['Encoding']
     optional_channels = tuple(
         {'id': 'd{}'.format(i), 'name': 'D{}'.format(i), 'desc': 'Data line {}'.format(i)}
         for i in range(MAX_CHANNELS)
@@ -175,7 +176,7 @@ class Decoder(srd.Decoder):
             if self.options['edges']:
                 self.turns.set(self.samplenum, self.count.get() // self.options['edges'])
 
-            if self.samplerate is not None:
+            if self.samplerate:
                 period = (curtime - prevtime) / self.samplerate
                 freq = abs(phasedelta_raw) / period