From decde15ecb51b3326b31019af61e0a729b9c61d0 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Wed, 25 Jan 2012 22:11:38 +0100 Subject: 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). --- decoders/usb/usb.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'decoders/usb/usb.py') 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 -- cgit v1.2.3-70-g09d2