Skip to content

Commit c85be32

Browse files
authored
Merge pull request #22 from tannewt/remove_stop
Remove stop kwarg and use write_then_readinto.
2 parents ebe7ea7 + b836f50 commit c85be32

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

adafruit_tcs34725.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,16 +340,16 @@ def _read_u8(self, address):
340340
# Read an 8-bit unsigned value from the specified 8-bit address.
341341
with self._device as i2c:
342342
self._BUFFER[0] = (address | _COMMAND_BIT) & 0xFF
343-
i2c.write(self._BUFFER, end=1, stop=False)
344-
i2c.readinto(self._BUFFER, end=1)
343+
i2c.write_then_readinto(self._BUFFER, self._BUFFER,
344+
out_end=1, in_end=1)
345345
return self._BUFFER[0]
346346

347347
def _read_u16(self, address):
348348
# Read a 16-bit unsigned value from the specified 8-bit address.
349349
with self._device as i2c:
350350
self._BUFFER[0] = (address | _COMMAND_BIT) & 0xFF
351-
i2c.write(self._BUFFER, end=1, stop=False)
352-
i2c.readinto(self._BUFFER, end=2)
351+
i2c.write_then_readinto(self._BUFFER, self._BUFFER,
352+
out_end=1, in_end=2)
353353
return (self._BUFFER[1] << 8) | self._BUFFER[0]
354354

355355
def _write_u8(self, address, val):

0 commit comments

Comments
 (0)