diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2012-01-25 22:11:38 +0100 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2012-01-25 23:49:32 +0100 |
commit | decde15ecb51b3326b31019af61e0a729b9c61d0 (patch) | |
tree | 362aefd1a9759731bdf8ee2cc3d533c83a7faa9a /decoders/dcf77 | |
parent | 385508e9b12d87519f9144a67e7682b46a592200 (diff) | |
download | libsigrokdecode-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/dcf77')
-rw-r--r-- | decoders/dcf77/dcf77.py | 7 |
1 files changed, 5 insertions, 2 deletions
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 |