From 930bd9d961b9a13259ffb4997be9fa6ebcdb9da9 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Sun, 18 Apr 2010 03:15:06 +0200 Subject: Python: Bugfixes (True/False != 1/0). --- scripts/transitioncounter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts/transitioncounter.py') diff --git a/scripts/transitioncounter.py b/scripts/transitioncounter.py index 7c9c6a3..c16ce46 100644 --- a/scripts/transitioncounter.py +++ b/scripts/transitioncounter.py @@ -41,7 +41,7 @@ def sigrokdecode_count_transitions(inbuf): # Presets... oldbyte = inbuf[0] for i in range(channels): - oldbit[i] = (oldbyte & (1 << i)) != 0 + oldbit[i] = (oldbyte & (1 << i)) >> i # Loop over all samples. # TODO: Handle LAs with more/less than 8 channels. @@ -50,7 +50,7 @@ def sigrokdecode_count_transitions(inbuf): if oldbyte == s: continue for i in range(channels): - curbit = (s & (1 << i) != 0) + curbit = (s & (1 << i)) >> i # Optimization: Skip identical bits (no transitions). if oldbit[i] == curbit: continue -- cgit v1.2.3-70-g09d2