Skip to content

Commit c4c479e

Browse files
committed
update to use write_then_readinto for repeated start, tested on m4 & raspi
1 parent 5f87b57 commit c4c479e

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

adafruit_mma8451.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,8 @@ def _read_into(self, address, buf, count=None):
126126
if count is None:
127127
count = len(buf)
128128
with self._device as i2c:
129-
buf[0] = address & 0xFF
130-
i2c.write(buf, end=1, stop=False)
131-
i2c.readinto(buf, end=count)
129+
i2c.write_then_readinto(bytes([address & 0xFF]), buf,
130+
in_end=count, stop=False)
132131

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

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
Adafruit-Blinka
2-
adafruit-circuitpython-busdevice
2+
adafruit-circuitpython-busdevice>=2.2.5

0 commit comments

Comments
 (0)