Skip to content
This repository was archived by the owner on Oct 29, 2019. It is now read-only.

Commit 976c75f

Browse files
committed
Remove stop kwarg and use write_then_readinto.
See adafruit/circuitpython#2082 for details.
1 parent 63ef37e commit 976c75f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

adafruit_lsm303.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,8 @@ def mag_rate(self, value):
240240
def _read_u8(self, device, address):
241241
with device as i2c:
242242
self._BUFFER[0] = address & 0xFF
243-
i2c.write(self._BUFFER, end=1, stop=False)
244-
i2c.readinto(self._BUFFER, end=1)
243+
i2c.write_then_readinto(self._BUFFER, self._BUFFER,
244+
out_end=1, in_end=1)
245245
return self._BUFFER[0]
246246

247247
def _write_u8(self, device, address, val):
@@ -254,5 +254,4 @@ def _write_u8(self, device, address, val):
254254
def _read_bytes(device, address, count, buf):
255255
with device as i2c:
256256
buf[0] = address & 0xFF
257-
i2c.write(buf, end=1, stop=False)
258-
i2c.readinto(buf, end=count)
257+
i2c.write_then_readinto(buf, buf, out_end=1, in_end=count)

0 commit comments

Comments
 (0)