From db48b5cd6a350ff55943d1afd48e55724eca44e0 Mon Sep 17 00:00:00 2001 From: Erik Andresen Date: Tue, 20 Dec 2016 21:36:33 +0100 Subject: [PATCH] i2c write fix --- bus_pirate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: -- 2.39.2