X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=decoders%2Fi2cdemux%2Fi2cdemux.py;h=6f2964933fbea75d379397ca9552729a7644173e;hb=363252b482d189c9cca596b146f5fb6ead6e3412;hp=a597188fc95b695e3ff8c4de76cdac6723a9c48c;hpb=156509ca42f0df2380c9f205f9aad337e1a07802;p=libsigrokdecode.git diff --git a/decoders/i2cdemux/i2cdemux.py b/decoders/i2cdemux/i2cdemux.py index a597188..6f29649 100644 --- a/decoders/i2cdemux/i2cdemux.py +++ b/decoders/i2cdemux/i2cdemux.py @@ -26,7 +26,7 @@ class Decoder(srd.Decoder): api_version = 1 id = 'i2cdemux' name = 'I2C demux' - longname = 'Generic I2C demultiplexer' + longname = 'I2C demultiplexer' desc = 'TODO.' longdesc = 'TODO.' license = 'gplv2+' @@ -57,10 +57,10 @@ class Decoder(srd.Decoder): # get the whole chunk of packets (from START to STOP). def decode(self, ss, es, data): - cmd, databyte, ack = data + cmd, databyte = data # Add the I2C packet to our local cache. - self.packets += [[ss, es, data]] + self.packets.append([ss, es, data]) if cmd in ('ADDRESS READ', 'ADDRESS WRITE'): if databyte in self.slaves: @@ -68,9 +68,9 @@ class Decoder(srd.Decoder): return # We're never seen this slave, add a new stream. - self.slaves += [databyte] - self.out_proto += [self.add(srd.OUTPUT_PROTO, - 'i2c-%s' % hex(databyte))] + self.slaves.append(databyte) + self.out_proto.append(self.add(srd.OUTPUT_PROTO, + 'i2c-%s' % hex(databyte))) self.stream = self.streamcount self.streamcount += 1 elif cmd == 'STOP':