summaryrefslogtreecommitdiff
path: root/decoders/transitioncounter.py
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2011-12-04 20:59:56 +0100
committerUwe Hermann <uwe@hermann-uwe.de>2011-12-04 20:59:56 +0100
commit1c8ac5bf07e0ded582234c9ef50ba10f042bae52 (patch)
tree8bb0cddb5ac81aa6da9edaf159bdfc22e6f1dce2 /decoders/transitioncounter.py
parentb2c19614a6c4eaa0170971d1261a1bb25212e277 (diff)
downloadlibsigrokdecode-1c8ac5bf07e0ded582234c9ef50ba10f042bae52.tar.gz
libsigrokdecode-1c8ac5bf07e0ded582234c9ef50ba10f042bae52.zip
srd: Update decoders to changed API.
Diffstat (limited to 'decoders/transitioncounter.py')
-rw-r--r--decoders/transitioncounter.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/decoders/transitioncounter.py b/decoders/transitioncounter.py
index 3946d4b..46b5ac4 100644
--- a/decoders/transitioncounter.py
+++ b/decoders/transitioncounter.py
@@ -18,6 +18,8 @@
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
+import sigrok
+
class Sample():
def __init__(self, data):
self.data = data
@@ -29,7 +31,7 @@ def sampleiter(data, unitsize):
for i in range(0, len(data), unitsize):
yield(Sample(data[i:i+unitsize]))
-class Decoder():
+class Decoder(sigrok.Decoder):
id = 'transitioncounter'
name = 'Transition counter'
longname = '...'
@@ -106,9 +108,5 @@ class Decoder():
outdata = []
for i in range(self.channels):
outdata += [[self.transitions[i], self.rising[i], self.falling[i]]]
- sigrok.put(outdata)
-
-import sigrok
-
-sigrok.register(Decoder)
+ self.put(outdata)