summaryrefslogtreecommitdiff
path: root/decoders/usb
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2012-03-21 19:28:43 +0100
committerUwe Hermann <uwe@hermann-uwe.de>2012-03-21 23:20:09 +0100
commit5a2c4dc462310a8a031abda7e6cbb0532873ec55 (patch)
tree45f83f5fba35bf0643ff021252b1179baa2dc7a1 /decoders/usb
parentabf77a8df245c31a8beb80be094972c4d188adab (diff)
downloadlibsigrokdecode-5a2c4dc462310a8a031abda7e6cbb0532873ec55.tar.gz
libsigrokdecode-5a2c4dc462310a8a031abda7e6cbb0532873ec55.zip
sr/srd: Small fixes, constifications, doc updates.
Diffstat (limited to 'decoders/usb')
-rw-r--r--decoders/usb/usb.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/decoders/usb/usb.py b/decoders/usb/usb.py
index bd402dd..576855f 100644
--- a/decoders/usb/usb.py
+++ b/decoders/usb/usb.py
@@ -105,14 +105,14 @@ class Decoder(srd.Decoder):
pass
def start(self, metadata):
- self.rate = metadata['samplerate']
+ self.samplerate = metadata['samplerate']
# self.out_proto = self.add(srd.OUTPUT_PROTO, 'usb')
self.out_ann = self.add(srd.OUTPUT_ANN, 'usb')
- if self.rate < 48000000:
- raise Exception('Sample rate (%d) not sufficient for USB '
- 'decoding, need at least 48MHz' % self.rate)
+ if self.samplerate < 48000000:
+ raise Exception('Samplerate (%d) not sufficient for USB '
+ 'decoding, need at least 48MHz' % self.samplerate)
# Initialise decoder state.
self.sym = 'J'
@@ -142,7 +142,7 @@ class Decoder(srd.Decoder):
# How many bits since the last transition?
if self.packet != '' or self.sym != 'J':
- bitcount = int((self.scount - 1) * 12000000 / self.rate)
+ bitcount = int((self.scount - 1) * 12000000 / self.samplerate)
else:
bitcount = 0