From: Uwe Hermann Date: Tue, 3 Jan 2012 18:36:30 +0000 (+0100) Subject: srd: *.py: Remove one incorrect ord() call. X-Git-Tag: libsigrokdecode-0.1.0~221 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=fb53ee5e242be7781b0d34a7d006c630095bcb72;p=libsigrokdecode.git srd: *.py: Remove one incorrect ord() call. While 'data' is of type 'bytes', 'data[0]' for example is of type 'int', thus the ord() there is neither needed nor correct anymore (yields an error). --- diff --git a/decoders/i2c.py b/decoders/i2c.py index 8b8e665..e082763 100644 --- a/decoders/i2c.py +++ b/decoders/i2c.py @@ -148,7 +148,7 @@ class Sample(): def __init__(self, data): self.data = data def probe(self, probe): - s = ord(self.data[probe / 8]) & (1 << (probe % 8)) + s = self.data[probe / 8] & (1 << (probe % 8)) return True if s else False def sampleiter(data, unitsize): diff --git a/decoders/mx25lxx05d.py b/decoders/mx25lxx05d.py index 973e065..36a53ee 100644 --- a/decoders/mx25lxx05d.py +++ b/decoders/mx25lxx05d.py @@ -161,7 +161,7 @@ class Sample(): def __init__(self, data): self.data = data def probe(self, probe): - s = ord(self.data[int(probe / 8)]) & (1 << (probe % 8)) + s = self.data[int(probe / 8)] & (1 << (probe % 8)) return True if s else False def sampleiter(data, unitsize): diff --git a/decoders/nunchuk.py b/decoders/nunchuk.py index fbc03d4..cc1252c 100644 --- a/decoders/nunchuk.py +++ b/decoders/nunchuk.py @@ -66,7 +66,7 @@ class Sample(): def __init__(self, data): self.data = data def probe(self, probe): - s = ord(self.data[int(probe / 8)]) & (1 << (probe % 8)) + s = self.data[int(probe / 8)] & (1 << (probe % 8)) return True if s else False def sampleiter(data, unitsize): diff --git a/decoders/spi.py b/decoders/spi.py index c2d3120..5489319 100644 --- a/decoders/spi.py +++ b/decoders/spi.py @@ -24,7 +24,7 @@ class Sample(): def __init__(self, data): self.data = data def probe(self, probe): - s = ord(self.data[int(probe / 8)]) & (1 << (probe % 8)) + s = self.data[int(probe / 8)] & (1 << (probe % 8)) return True if s else False def sampleiter(data, unitsize): diff --git a/decoders/srd_usb.py b/decoders/srd_usb.py index a223dbb..2db0158 100644 --- a/decoders/srd_usb.py +++ b/decoders/srd_usb.py @@ -46,7 +46,7 @@ class Sample(): def __init__(self, data): self.data = data def probe(self, probe): - s = ord(self.data[int(probe / 8)]) & (1 << (probe % 8)) + s = self.data[int(probe / 8)] & (1 << (probe % 8)) return True if s else False def sampleiter(data, unitsize): diff --git a/decoders/transitioncounter.py b/decoders/transitioncounter.py index 9a5641d..70f1f1a 100644 --- a/decoders/transitioncounter.py +++ b/decoders/transitioncounter.py @@ -24,7 +24,7 @@ class Sample(): def __init__(self, data): self.data = data def probe(self, probe): - s = ord(self.data[int(probe / 8)]) & (1 << (probe % 8)) + s = self.data[int(probe / 8)] & (1 << (probe % 8)) return True if s else False def sampleiter(data, unitsize): diff --git a/decoders/uart.py b/decoders/uart.py index 93de9e2..7a63d77 100644 --- a/decoders/uart.py +++ b/decoders/uart.py @@ -131,7 +131,7 @@ class Sample(): def __init__(self, data): self.data = data def probe(self, probe): - s = ord(self.data[probe / 8]) & (1 << (probe % 8)) + s = self.data[probe / 8] & (1 << (probe % 8)) return True if s else False def sampleiter(data, unitsize):