X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=decoders%2Fuart%2Fuart.py;h=24551da6d03e177854e289178173512fa8704b98;hb=92d1aba34bbe661b388e874fda0a41f477d3e30d;hp=bb4d9e62c22e75f9b1513e9c8ab42a9b4e799b11;hpb=a465436e627578f69c403de75a89522dfd883217;p=libsigrokdecode.git diff --git a/decoders/uart/uart.py b/decoders/uart/uart.py index bb4d9e6..24551da 100644 --- a/decoders/uart/uart.py +++ b/decoders/uart/uart.py @@ -103,6 +103,7 @@ class Decoder(srd.Decoder): self.startsample = [-1, -1] self.state = ['WAIT FOR START BIT', 'WAIT FOR START BIT'] self.oldbit = [None, None] + self.oldpins = None def start(self, metadata): self.samplerate = metadata['samplerate'] @@ -265,7 +266,13 @@ class Decoder(srd.Decoder): def decode(self, ss, es, data): # TODO: Either RX or TX could be omitted (optional probe). - for (self.samplenum, (rx, tx)) in data: + for (self.samplenum, pins) in data: + + # Note: Ignoring identical samples here for performance reasons + # is not possible for this PD, at least not in the current state. + # if self.oldpins == pins: + # continue + self.oldpins, (rx, tx) = pins, pins # First sample: Save RX/TX value. if self.oldbit[RX] == None: