X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=decoders%2Fi2c.py;h=cfaacb0f86864b916fffe7778f4a922b6560afc6;hb=b1bb5eed4ad056f760bec83e784699dabbd72a18;hp=15ef9c617dfb1526f6baf17914d71f2eca578cd5;hpb=bf1c3f4db0ffbc05f29f81541c551c691ccd2ba7;p=libsigrokdecode.git diff --git a/decoders/i2c.py b/decoders/i2c.py index 15ef9c6..cfaacb0 100644 --- a/decoders/i2c.py +++ b/decoders/i2c.py @@ -120,7 +120,7 @@ FIND_DATA = 2 class Decoder(srd.Decoder): id = 'i2c' name = 'I2C' - longname = 'Inter-Integrated Circuit (I2C) bus' + longname = 'Inter-Integrated Circuit' desc = 'I2C is a two-wire, multi-master, serial bus.' longdesc = '...' author = 'Uwe Hermann' @@ -240,16 +240,10 @@ class Decoder(srd.Decoder): cmd = 'DATA_READ' self.put(self.out_proto, [cmd, d, ack_bit]) - self.put(self.out_ann, [ANN_SHIFTED, [ - '%s' % protocol[cmd][0], - '0x%02x' % d, - '%s' % protocol[ack_bit][0]] - ]) - self.put(self.out_ann, [ANN_SHIFTED_SHORT, [ - '%s' % protocol[cmd][1], - '0x%02x' % d, - '%s' % protocol[ack_bit][1]] - ]) + self.put(self.out_ann, [ANN_SHIFTED, + [protocol[cmd][0], '0x%02x' % d, protocol[ack_bit][0]]]) + self.put(self.out_ann, [ANN_SHIFTED_SHORT, + [protocol[cmd][1], '0x%02x' % d, protocol[ack_bit][1]]]) self.bitcount = self.databyte = 0 self.startsample = -1 @@ -275,7 +269,7 @@ class Decoder(srd.Decoder): # TODO: 0-0 sample range for now. super(Decoder, self).put(0, 0, output_id, data) - def decode(self, timeoffset, duration, data): + def decode(self, ss, es, data): for samplenum, (scl, sda) in data: self.samplecnt += 1