From 91e40dee788fac32de09ddf45281245eb0fb4728 Mon Sep 17 00:00:00 2001 From: Fabio Pugliese Ornellas Date: Wed, 1 Sep 2021 21:51:09 +0100 Subject: [PATCH] Patch to fix issue with #430 --- libsigrokdecode4DSL/decoders/uart/pd.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/libsigrokdecode4DSL/decoders/uart/pd.py b/libsigrokdecode4DSL/decoders/uart/pd.py index 0c501b0dc..457e14b35 100644 --- a/libsigrokdecode4DSL/decoders/uart/pd.py +++ b/libsigrokdecode4DSL/decoders/uart/pd.py @@ -559,17 +559,18 @@ def decode(self): cond_idle_idx[TX] = len(conds) conds.append(idle_cond) (rx, tx) = self.wait(conds) - if cond_data_idx[RX] is not None and self.matched[cond_data_idx[RX]]: + + if cond_data_idx[RX] is not None and (self.matched & (0b1 << cond_data_idx[RX])): self.inspect_sample(RX, rx, inv[RX]) - if cond_edge_idx[RX] is not None and self.matched[cond_edge_idx[RX]]: + if cond_edge_idx[RX] is not None and (self.matched & (0b1 << cond_edge_idx[RX])): self.inspect_edge(RX, rx, inv[RX]) self.inspect_idle(RX, rx, inv[RX]) - if cond_idle_idx[RX] is not None and self.matched[cond_idle_idx[RX]]: + if cond_idle_idx[RX] is not None and (self.matched & (0b1 << cond_idle_idx[RX])): self.inspect_idle(RX, rx, inv[RX]) - if cond_data_idx[TX] is not None and self.matched[cond_data_idx[TX]]: + if cond_data_idx[TX] is not None and (self.matched & (0b1 << cond_data_idx[TX])): self.inspect_sample(TX, tx, inv[TX]) - if cond_edge_idx[TX] is not None and self.matched[cond_edge_idx[TX]]: + if cond_edge_idx[TX] is not None and (self.matched & (0b1 << cond_edge_idx[TX])): self.inspect_edge(TX, tx, inv[TX]) self.inspect_idle(TX, tx, inv[TX]) - if cond_idle_idx[TX] is not None and self.matched[cond_idle_idx[TX]]: + if cond_idle_idx[TX] is not None and (self.matched & (0b1 << cond_idle_idx[TX])): self.inspect_idle(TX, tx, inv[TX])