]> sigrok.org Git - libsigrokdecode.git/commit - decoders/uart/pd.py
uart: Improve robustness of query API result processing
authorGerhard Sittig <redacted>
Tue, 14 Mar 2017 17:46:32 +0000 (18:46 +0100)
committerGerhard Sittig <redacted>
Tue, 14 Mar 2017 18:30:53 +0000 (19:30 +0100)
commit7d62e5b33a3404d319f42c81f3344240d430746a
treed8b359962e124979f707a9fdd56eb95ed7c08ee2
parent0de2810f223fefc9e3040adaa7f1b97616c6931d
uart: Improve robustness of query API result processing

Since either of the UART signals (RX, TX) is optional, and in the
absence of Decoder.wait() conditions that "will never match", we cannot
construct a constant layout. Instead we need to explicitly keep track of
which item in the list of wait conditions corresponds to which signal.

Once the index in the list of wait conditions is known, inspection of
samples can depend on the Decoder.matched[] attribute. Before this
change, redundant reached_bit() checks kept us from processing samples
that should not have been inspected. Tests pass before and after this
very commit.
decoders/uart/pd.py