summaryrefslogtreecommitdiff
path: root/decoders
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2011-12-07 19:45:40 +0100
committerUwe Hermann <uwe@hermann-uwe.de>2011-12-10 20:01:44 +0100
commit5b6b4f7759cf726bbfc00bd30b2e02cdea33cc6d (patch)
tree6430dbc947a3a8f3f96557f330ff245a67f95eef /decoders
parent6efe1e1106bd648705f6f704ed2f267c86035dac (diff)
downloadlibsigrokdecode-5b6b4f7759cf726bbfc00bd30b2e02cdea33cc6d.tar.gz
libsigrokdecode-5b6b4f7759cf726bbfc00bd30b2e02cdea33cc6d.zip
srd: UART: Simplify a code snippet.
Diffstat (limited to 'decoders')
-rw-r--r--decoders/uart.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/decoders/uart.py b/decoders/uart.py
index efc1756..a089aa1 100644
--- a/decoders/uart.py
+++ b/decoders/uart.py
@@ -370,9 +370,7 @@ class Decoder(sigrok.Decoder):
# TODO: Currently only supports 1 stop bit.
def get_stop_bits(self, signal):
# Skip samples until we're in the middle of the stop bit(s).
- skip_parity = 0
- if self.parity != PARITY_NONE:
- skip_parity = 1
+ skip_parity = 0 if self.parity == PARITY_NONE else 1
if not self.reached_bit(self.num_data_bits + 1 + skip_parity):
return []