summaryrefslogtreecommitdiff
path: root/decoders/uart/pd.py
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2014-08-10 09:22:29 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2014-08-14 17:44:20 +0200
commitf04964c696336f5699a099bbd64785f199d91f4c (patch)
tree78c63f1f0c5c4ac6d2e0b022bc9d463a43f40300 /decoders/uart/pd.py
parent8aeedf9ee376f1b48fe9c42924ebf34f9c8c2ddd (diff)
downloadlibsigrokdecode-f04964c696336f5699a099bbd64785f199d91f4c.tar.gz
libsigrokdecode-f04964c696336f5699a099bbd64785f199d91f4c.zip
spi/nrf24l01/uart: Use ChannelError exception.
Rename the old MissingDataError to the clearer ChannelError. Also, add ChannelError in the UART decoder.
Diffstat (limited to 'decoders/uart/pd.py')
-rw-r--r--decoders/uart/pd.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/decoders/uart/pd.py b/decoders/uart/pd.py
index fef3aa5..d13a119 100644
--- a/decoders/uart/pd.py
+++ b/decoders/uart/pd.py
@@ -70,6 +70,9 @@ def parity_ok(parity_type, parity_bit, data, num_data_bits):
class SamplerateError(Exception):
pass
+class ChannelError(Exception):
+ pass
+
class Decoder(srd.Decoder):
api_version = 2
id = 'uart'
@@ -336,7 +339,7 @@ class Decoder(srd.Decoder):
# Either RX or TX (but not both) can be omitted.
has_pin = [rx in (0, 1), tx in (0, 1)]
if has_pin == [False, False]:
- raise Exception('Either TX or RX (or both) pins required.')
+ raise ChannelError('Either TX or RX (or both) pins required.')
# State machine.
for rxtx in (RX, TX):