From: Michalis Pappas Date: Sat, 26 Jan 2019 21:28:04 +0000 (+0100) Subject: atsha204a: Only call output_tx_bytes() when the bytes buffer is not empty X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=commitdiff_plain;h=c35a4d56d561920def33005b775e3544ad830013;hp=9e23c0982cd1a902f0ec1d6fe64a5cb4ca4e981b atsha204a: Only call output_tx_bytes() when the bytes buffer is not empty --- diff --git a/decoders/atsha204a/pd.py b/decoders/atsha204a/pd.py index d149c49..8e37e5b 100644 --- a/decoders/atsha204a/pd.py +++ b/decoders/atsha204a/pd.py @@ -287,7 +287,6 @@ class Decoder(srd.Decoder): def decode(self, ss, es, data): cmd, databyte = data - # State machine. if self.state == 'IDLE': # Wait for an I²C START condition. @@ -309,7 +308,8 @@ class Decoder(srd.Decoder): # Reset the opcode before received data, as this causes # responses to be displayed incorrectly. self.opcode = -1 - self.output_rx_bytes() + if len(self.bytes) > 0: + self.output_rx_bytes() self.waddr = -1 self.bytes = [] self.state = 'IDLE'