Skip to content

Commit 85f2e10

Browse files
authored
Merge pull request #8 from tannewt/remove_stop
Remove stop kwarg and use write_then_readinto.
2 parents 71c5a54 + f739bc9 commit 85f2e10

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

adafruit_si4713.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,9 @@ def _read_u8(self, address):
147147
# Read an 8-bit unsigned value from the specified 8-bit address.
148148
with self._device as i2c:
149149
self._BUFFER[0] = address & 0xFF
150-
i2c.write(self._BUFFER, end=1, stop=True)
150+
# TODO: This is probably wrong and should be write_then_readinto to avoid a stop before
151+
# repeated start.
152+
i2c.write(self._BUFFER, end=1)
151153
i2c.readinto(self._BUFFER, end=1)
152154
return self._BUFFER[0]
153155

@@ -169,8 +171,9 @@ def _write_from(self, buf, count=None):
169171
if count is None:
170172
count = len(buf)
171173
# Send command.
174+
# TODO: This probably needs to be one write_then_readinto.
172175
with self._device as i2c:
173-
i2c.write(buf, end=count, stop=True)
176+
i2c.write(buf, end=count)
174177
# Poll the status bit waiting for success or throwing a timeout error.
175178
start = time.monotonic()
176179
while True:

0 commit comments

Comments
 (0)