X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=decoders%2Fuart%2Fuart.py;h=24551da6d03e177854e289178173512fa8704b98;hb=92d1aba34bbe661b388e874fda0a41f477d3e30d;hp=a478c8eb7906019ea21fcb5c35e57683420f6162;hpb=4180cba9a51acd32f69f0f8628bb746ea3e12be6;p=libsigrokdecode.git diff --git a/decoders/uart/uart.py b/decoders/uart/uart.py index a478c8e..24551da 100644 --- a/decoders/uart/uart.py +++ b/decoders/uart/uart.py @@ -61,7 +61,7 @@ class Decoder(srd.Decoder): id = 'uart' name = 'UART' longname = 'Universal Asynchronous Receiver/Transmitter' - desc = 'Universal Asynchronous Receiver/Transmitter (UART)' + desc = 'Asynchronous, serial bus.' license = 'gplv2+' inputs = ['logic'] outputs = ['uart'] @@ -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: