diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2014-07-09 17:31:32 +0200 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2014-07-09 18:00:22 +0200 |
commit | 22fc7ace72f3165c98208a8f544156e04a709639 (patch) | |
tree | 98b15ab45b4f81b34511765688a7df83a6ec03a1 /decoders/uart | |
parent | 21b39043472eeeb2e0155eafc73247f5010af714 (diff) | |
download | libsigrokdecode-22fc7ace72f3165c98208a8f544156e04a709639.tar.gz libsigrokdecode-22fc7ace72f3165c98208a8f544156e04a709639.zip |
uart/i2cfilter: Don't check multiple-choice options.
For options which only have a limited set of valid values, we don't need
to check (in the PD) whether a valid value was supplied, since the backend
can do that for us.
Diffstat (limited to 'decoders/uart')
-rw-r--r-- | decoders/uart/pd.py | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/decoders/uart/pd.py b/decoders/uart/pd.py index da5e303..63ea50d 100644 --- a/decoders/uart/pd.py +++ b/decoders/uart/pd.py @@ -66,8 +66,6 @@ def parity_ok(parity_type, parity_bit, data, num_data_bits): return (ones % 2) == 1 elif parity_type == 'even': return (ones % 2) == 0 - else: - raise Exception('Invalid parity type: %d' % parity_type) class SamplerateError(Exception): pass @@ -242,12 +240,9 @@ class Decoder(srd.Decoder): self.databyte[rxtx] >>= 1 self.databyte[rxtx] |= \ (signal << (self.options['num_data_bits'] - 1)) - elif self.options['bit_order'] == 'msb-first': + else: self.databyte[rxtx] <<= 1 self.databyte[rxtx] |= (signal << 0) - else: - raise Exception('Invalid bit order value: %s', - self.options['bit_order']) self.putg([rxtx + 12, ['%d' % signal]]) @@ -277,8 +272,6 @@ class Decoder(srd.Decoder): self.putx(rxtx, [rxtx, [oct(b)[2:].zfill(3)]]) elif f == 'bin': self.putx(rxtx, [rxtx, [bin(b)[2:].zfill(8)]]) - else: - raise Exception('Invalid data format option: %s' % f) self.putbin(rxtx, (rxtx, bytes([b]))) self.putbin(rxtx, (2, bytes([b]))) |