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/dcf77/dcf77.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'decoders/dcf77') diff --git a/decoders/dcf77/dcf77.py b/decoders/dcf77/dcf77.py index b7e029d..5379592 100644 --- a/decoders/dcf77/dcf77.py +++ b/decoders/dcf77/dcf77.py @@ -57,6 +57,9 @@ class Decoder(srd.Decoder): probes = [ {'id': 'data', 'name': 'DATA', 'desc': 'DATA line'}, ] + extra_probes = [ + {'id': 'pon', 'name': 'PON', 'desc': 'TODO'}, + ] options = {} annotations = [ # ANN_ASCII @@ -211,7 +214,7 @@ class Decoder(srd.Decoder): raise Exception('Invalid DCF77 bit: %d' % c) def decode(self, ss, es, data): - for samplenum, (pon, val) in data: # FIXME + for samplenum, (val) in data: # TODO: Handle optional PON. self.samplenum += 1 # FIXME. Use samplenum. Off-by-one? @@ -272,7 +275,7 @@ class Decoder(srd.Decoder): self.state = WAIT_FOR_RISING_EDGE else: - raise Exception('Invalid state: %s' % self.state) + raise Exception('Invalid state: %d' % self.state) self.oldval = val -- cgit v1.2.3-70-g09d2