]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/i2c.py
srd: Add MX25Lxx05D SPI chip decoder.
[libsigrokdecode.git] / decoders / i2c.py
index 2b3b8756f7ad8fe4cee12f0c154aebc55e064694..659ea553b6c77949684c849ab1337749d303e45c 100644 (file)
@@ -240,12 +240,12 @@ class Decoder(sigrok.Decoder):
         # We received 8 address/data bits and the ACK/NACK bit.
         self.databyte >>= 1 # Shift out unwanted ACK/NACK bit here.
 
-        ack = (sda == 1) and 'N' or 'A'
+        ack = 'N' if (sda == 1) else 'A'
 
         if self.state == FIND_ADDRESS:
             d = self.databyte & 0xfe
             # The READ/WRITE bit is only in address bytes, not data bytes.
-            self.wr = (self.databyte & 1) and 1 or 0
+            self.wr = 1 if (self.databyte & 1) else 0
         elif self.state == FIND_DATA:
             d = self.databyte
         else: