From: Erik Andresen Date: Tue, 20 Dec 2016 20:36:33 +0000 (+0100) Subject: i2c write fix X-Git-Url: https://defiant.homedns.org/gitweb/?p=pyshared.git;a=commitdiff_plain;h=db48b5cd6a350ff55943d1afd48e55724eca44e0 i2c write fix --- diff --git a/bus_pirate.py b/bus_pirate.py index a148f1a..08305f5 100644 --- a/bus_pirate.py +++ b/bus_pirate.py @@ -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: