Skip to content

Commit 5a3bb08

Browse files
committed
repeated start for linux
1 parent 3bdb410 commit 5a3bb08

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

adafruit_mpl3115a2.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,7 @@ def _read_into(self, address, buf, count=None):
139139
if count is None:
140140
count = len(buf)
141141
with self._device as i2c:
142-
buf[0] = address & 0xFF
143-
i2c.write(buf, end=1, stop=False)
144-
i2c.readinto(buf, end=count)
142+
i2c.write_then_readinto(bytes([address & 0xFF]), buf, in_end=count, stop=False)
145143

146144
def _read_u8(self, address):
147145
# Read an 8-bit unsigned value from the specified 8-bit address.

0 commit comments

Comments
 (0)