X-Git-Url: https://git.ayoreis.com/Adafruit_Blinka-hackapet.git/blobdiff_plain/e30741d3693ac0c8101342fd639e92cd264de52a..02b66d1a6f44c9fcc3d220db389eb8f97913cae0:/src/adafruit_blinka/microcontroller/ft232h/spi.py?ds=inline diff --git a/src/adafruit_blinka/microcontroller/ft232h/spi.py b/src/adafruit_blinka/microcontroller/ft232h/spi.py index 81797b3..c768eaf 100644 --- a/src/adafruit_blinka/microcontroller/ft232h/spi.py +++ b/src/adafruit_blinka/microcontroller/ft232h/spi.py @@ -67,7 +67,8 @@ class SPI: def readinto(self, buf, start=0, end=None, write_value=0): """Read data from SPI and into the buffer""" end = end if end else len(buf) - result = self._port.read(end - start) + buffer_out = [write_value] * (end - start) + result = self._port.exchange(buffer_out, end - start, duplex=True) for i, b in enumerate(result): buf[start + i] = b