summaryrefslogtreecommitdiff
path: root/decoders/usb/usb.py
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2012-01-25 22:11:38 +0100
committerUwe Hermann <uwe@hermann-uwe.de>2012-01-25 23:49:32 +0100
commitdecde15ecb51b3326b31019af61e0a729b9c61d0 (patch)
tree362aefd1a9759731bdf8ee2cc3d533c83a7faa9a /decoders/usb/usb.py
parent385508e9b12d87519f9144a67e7682b46a592200 (diff)
downloadlibsigrokdecode-decde15ecb51b3326b31019af61e0a729b9c61d0.tar.gz
libsigrokdecode-decde15ecb51b3326b31019af61e0a729b9c61d0.zip
srd: All PDs: Various fixes, cosmetics.
- List all API methods and metadata variables in all PDs to make things easier and more consistent for new PD writers. - Fix probe assignment in a few PDs. - Raise exceptions upon invalid states of the PD state machines (bug).
Diffstat (limited to 'decoders/usb/usb.py')
-rw-r--r--decoders/usb/usb.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/decoders/usb/usb.py b/decoders/usb/usb.py
index 2df03c0..6441526 100644
--- a/decoders/usb/usb.py
+++ b/decoders/usb/usb.py
@@ -118,6 +118,7 @@ class Decoder(srd.Decoder):
{'id': 'dp', 'name': 'D+', 'desc': 'USB D+ signal'},
{'id': 'dm', 'name': 'D-', 'desc': 'USB D- signal'},
]
+ extra_probes = []
options = {}
annotations = [
['TODO', 'TODO']
@@ -133,17 +134,18 @@ class Decoder(srd.Decoder):
self.out_ann = self.add(srd.OUTPUT_ANN, 'usb')
if self.rate < 48000000:
- raise Exception('Sample rate not sufficient for USB decoding')
+ raise Exception('Sample rate (%d) not sufficient for USB '
+ 'decoding, need at least 48MHz' % self.rate)
# Initialise decoder state.
self.sym = J
self.scount = 0
self.packet = ''
- def decode(self, ss, es, data):
+ def report(self):
+ pass
- # FIXME
- # for (samplenum, (dp, dm, x, y, z, a)) in data:
+ def decode(self, ss, es, data):
for (samplenum, (dm, dp)) in data:
self.scount += 1