Skip to content

Commit 7aa7496

Browse files
committed
Move write buffer debug print.
1 parent d8a7033 commit 7aa7496

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

adafruit_bus_device/i2c_device.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,14 @@ def write_then_readinto(self, out_buffer, in_buffer, *,
148148
if in_end is None:
149149
in_end = len(in_buffer)
150150
if hasattr(self.i2c, 'writeto_then_readfrom'):
151+
if self._debug:
152+
print("i2c_device.writeto_then_readfrom.out_buffer:",
153+
[hex(i) for i in out_buffer[out_start:out_end]])
151154
# In linux, at least, this is a special kernel function call
152155
self.i2c.writeto_then_readfrom(self.device_address, out_buffer, in_buffer,
153156
out_start=out_start, out_end=out_end,
154157
in_start=in_start, in_end=in_end, stop=stop)
155158
if self._debug:
156-
print("i2c_device.writeto_then_readfrom.out_buffer:",
157-
[hex(i) for i in out_buffer[out_start:out_end]])
158159
print("i2c_device.writeto_then_readfrom.in_buffer:",
159160
[hex(i) for i in in_buffer[in_start:in_end]])
160161
else:

0 commit comments

Comments
 (0)