]> defiant.homedns.org Git - pyshared.git/commitdiff
i2c write fix
authorErik Andresen <erik@vontaene.de>
Tue, 20 Dec 2016 20:36:33 +0000 (21:36 +0100)
committerErik Andresen <erik@vontaene.de>
Tue, 20 Dec 2016 20:36:33 +0000 (21:36 +0100)
bus_pirate.py

index a148f1a67f16b4a0251bc1ed704750d5d3929088..08305f5837e308b35307ca5ad000973195cebeae 100644 (file)
@@ -139,7 +139,7 @@ class BP:
                self.i2c_write(addr, reg, "")
 
                # command (1) | number of write bytes (2) | number of read bytes (2) | bytes to write (0..)
-               msg = struct.pack(">BHHB", 0x08, 1, 1+num_read, (addr<<1) | 0x1)
+               msg = struct.pack(">BHHB", 0x08, 1, num_read, (addr<<1) | 0x1)
                ret = self.command(msg, 1 + num_read)
 
                if ord(ret[0]) != 0x1: