Use transferBytes when we want to receive data

This commit is contained in:
Kristian Sloth Lauszus 2016-10-26 00:58:51 -05:00
parent 231fb542a8
commit 6af321a7ac

View file

@ -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);