From a156f09eac00be0f6d8beaeadef77b03077ab7b1 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Sat, 24 Apr 2010 01:33:52 +0200 Subject: Various small decoder script fixes. --- scripts/transitioncounter.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'scripts/transitioncounter.py') diff --git a/scripts/transitioncounter.py b/scripts/transitioncounter.py index 4064d2f..a6d331e 100644 --- a/scripts/transitioncounter.py +++ b/scripts/transitioncounter.py @@ -35,10 +35,7 @@ def decode(inbuf): rising = [0] * channels falling = [0] * channels - # print len(inbuf) - # print type(inbuf) - - # Presets... + # Initial values. oldbyte = inbuf[0] for i in range(channels): oldbit[i] = (oldbyte & (1 << i)) >> i @@ -59,6 +56,7 @@ def decode(inbuf): elif (oldbit[i] == 1 and curbit == 0): falling[i] += 1 oldbit[i] = curbit + oldbyte = s # Total number of transitions is the sum of rising and falling edges. for i in range(channels): @@ -81,8 +79,7 @@ def register(): return { 'id': 'transitioncounter', 'name': 'Transition counter', - 'desc': 'TODO', - 'func': 'decode', + 'desc': 'Count rising/falling edges', 'inputformats': ['raw'], 'signalnames': {}, # FIXME 'outputformats': ['transitioncounts'], -- cgit v1.2.3-70-g09d2