cmd, databyte, ack_bit = 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'):
# print(hex(databyte))
cmd, databyte, ack = 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:
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':
self.state = 'GET TEMPERATURE'
elif self.state == 'GET TEMPERATURE':
if len(self.data) == 0:
- self.data += [databyte]
+ self.data.append(databyte)
self.ss = ss
elif len(self.data) == 1:
- self.data += [databyte]
+ self.data.append(databyte)
self.es = es
else:
kelvin = (self.data[0] | (self.data[1] << 8)) * 0.02
self.putx([0, ['%s ID' % d]])
elif self.cmdstate == 6:
# Byte 6: Slave sends device ID (or manufacturer ID).
- self.ids += [miso]
+ self.ids.append(miso)
d = 'Manufacturer' if self.manufacturer_id_first else 'Device'
self.putx([0, ['%s ID' % d]])
else:
# TODO: How to only output something after the last chunk of data?
outdata = []
for i in range(self.channels):
- outdata += [[self.transitions[i], self.rising[i], self.falling[i]]]
+ outdata.append([self.transitions[i], self.rising[i],
+ self.falling[i]])
if outdata != []:
# self.put(0, 0, self.out_proto, out_proto)