From 6af321a7ac6c735f8fc8e3224e2c408cac7625b2 Mon Sep 17 00:00:00 2001 From: Kristian Sloth Lauszus Date: Wed, 26 Oct 2016 00:58:51 -0500 Subject: [PATCH] Use transferBytes when we want to receive data --- usbhost.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usbhost.h b/usbhost.h index 3e8bd7a8..6eb8d663 100644 --- a/usbhost.h +++ b/usbhost.h @@ -332,11 +332,11 @@ uint8_t* MAX3421e< SPI_SS, INTR >::bytesRd(uint8_t reg, uint8_t nbytes, uint8_t* SPI.transfer(reg); memset(data_p, 0, nbytes); // Make sure we send out empty bytes #ifdef ESP8266 - SPI.writeBytes(data_p, nbytes); + SPI.transferBytes(data_p, data_p, nbytes); #else SPI.transfer(data_p, nbytes); -#endif data_p += nbytes; +#endif #elif defined(__ARDUINO_X86__) SPI.transfer(reg); SPI.transferBuffer(NULL, data_p, nbytes);