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/ddc | |
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/ddc')
-rw-r--r-- | decoders/ddc/ddc.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/decoders/ddc/ddc.py b/decoders/ddc/ddc.py index 349b2ec..f59be8e 100644 --- a/decoders/ddc/ddc.py +++ b/decoders/ddc/ddc.py @@ -38,6 +38,7 @@ class Decoder(srd.Decoder): inputs = ['i2c'] outputs = ['ddc'] probes = [] + extra_probes = [] options = {} annotations = [ ['Byte stream', 'DDC byte stream as read from display.'], @@ -49,11 +50,14 @@ class Decoder(srd.Decoder): def start(self, metadata): self.out_ann = self.add(srd.OUTPUT_ANN, 'ddc') + def report(self): + pass + def decode(self, ss, es, data): try: cmd, data, ack_bit = data except Exception as e: - raise Exception('malformed I2C input: %s' % str(e)) from e + raise Exception('Malformed I2C input: %s' % str(e)) from e if self.state is None: # Wait for the DDC session to start. @@ -72,4 +76,6 @@ class Decoder(srd.Decoder): # There shouldn't be anything but data reads on this # address, so ignore everything else. self.put(ss, es, self.out_ann, [0, ['0x%.2x' % data]]) + else: + raise Exception('Invalid state: %s' % self.state) |