summaryrefslogtreecommitdiff
path: root/decoders/uart/pd.py
diff options
context:
space:
mode:
authorElrond <elrond+sigrok.org@samba-tng.org>2015-10-21 16:17:19 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2015-10-22 20:20:58 +0200
commit76a4498f3a1eb0ce3919c3ce72fad76f99049942 (patch)
treeb9164798aee2028fe7e3bfd7427bb597ff218f71 /decoders/uart/pd.py
parent943f9176255c63924fcf55c6ba8bad05e91d4923 (diff)
downloadlibsigrokdecode-76a4498f3a1eb0ce3919c3ce72fad76f99049942.tar.gz
libsigrokdecode-76a4498f3a1eb0ce3919c3ce72fad76f99049942.zip
UART: Handle framing errors better
1. Show Frame Error on the Start bit 2. Don't overwrite framing errors with (valid) start/stop bit info
Diffstat (limited to 'decoders/uart/pd.py')
-rw-r--r--decoders/uart/pd.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/decoders/uart/pd.py b/decoders/uart/pd.py
index 7995e99..9b3a6bd 100644
--- a/decoders/uart/pd.py
+++ b/decoders/uart/pd.py
@@ -225,6 +225,7 @@ class Decoder(srd.Decoder):
# The startbit must be 0. If not, we report an error.
if self.startbit[rxtx] != 0:
self.putp(['INVALID STARTBIT', rxtx, self.startbit[rxtx]])
+ self.putg([rxtx + 10, ['Frame error', 'Frame err', 'FE']])
# TODO: Abort? Ignore rest of the frame?
self.cur_data_bit[rxtx] = 0
@@ -324,7 +325,7 @@ class Decoder(srd.Decoder):
# Stop bits must be 1. If not, we report an error.
if self.stopbit1[rxtx] != 1:
self.putp(['INVALID STOPBIT', rxtx, self.stopbit1[rxtx]])
- self.putg([rxtx + 8, ['Frame error', 'Frame err', 'FE']])
+ self.putg([rxtx + 10, ['Frame error', 'Frame err', 'FE']])
# TODO: Abort? Ignore the frame? Other?
self.state[rxtx] = 'WAIT FOR START BIT'