Skip to content

Commit 97d4129

Browse files
authored
Merge pull request #21 from ladyada/master
specifically name arguments now that we require it
2 parents 76bce0d + c6e7954 commit 97d4129

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

adafruit_bus_device/i2c_device.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,15 @@ def write_then_readinto(self, out_buffer, in_buffer, *,
128128
:param int in_end: Index to write up to but not include
129129
:param bool stop: If true, output an I2C stop condition after the buffer is written
130130
"""
131+
if out_end is None:
132+
out_end = len(out_buffer)
133+
if in_end is None:
134+
in_end = len(in_buffer)
131135
if hasattr(self.i2c, 'writeto_then_readfrom'):
132136
# In linux, at least, this is a special kernel function call
133137
self.i2c.writeto_then_readfrom(self.device_address, out_buffer, in_buffer,
134-
out_start, out_end, in_start, in_end, stop)
138+
out_start=out_start, out_end=out_end,
139+
in_start=in_start, in_end=in_end, stop=stop)
135140
else:
136141
# If we don't have a special implementation, we can fake it with two calls
137142
self.write(out_buffer, start=out_start, end=out_end, stop=stop)

0 commit comments

Comments
 (0)