From b836f5043f9bc82ab31194b15e87ae679081bc05 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 20 Aug 2019 22:06:04 -0700 Subject: [PATCH] Remove stop kwarg and use write_then_readinto. See https://github.com/adafruit/circuitpython/issues/2082 for details. --- adafruit_tcs34725.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/adafruit_tcs34725.py b/adafruit_tcs34725.py index a4eb251..81d23d5 100644 --- a/adafruit_tcs34725.py +++ b/adafruit_tcs34725.py @@ -340,16 +340,16 @@ def _read_u8(self, address): # Read an 8-bit unsigned value from the specified 8-bit address. with self._device as i2c: self._BUFFER[0] = (address | _COMMAND_BIT) & 0xFF - i2c.write(self._BUFFER, end=1, stop=False) - i2c.readinto(self._BUFFER, end=1) + i2c.write_then_readinto(self._BUFFER, self._BUFFER, + out_end=1, in_end=1) return self._BUFFER[0] def _read_u16(self, address): # Read a 16-bit unsigned value from the specified 8-bit address. with self._device as i2c: self._BUFFER[0] = (address | _COMMAND_BIT) & 0xFF - i2c.write(self._BUFFER, end=1, stop=False) - i2c.readinto(self._BUFFER, end=2) + i2c.write_then_readinto(self._BUFFER, self._BUFFER, + out_end=1, in_end=2) return (self._BUFFER[1] << 8) | self._BUFFER[0] def _write_u8(self, address, val):