SPI settings fix for ESP

This commit is contained in:
Felix Rusu 2020-01-21 12:57:21 -05:00
parent e6adf4e6d5
commit d8f8892377
1 changed files with 3 additions and 3 deletions

View File

@ -475,15 +475,15 @@ void RFM69::select() {
#ifdef SPI_HAS_TRANSACTION
SPI.beginTransaction(_settings);
#endif
// set RFM69 SPI settings
#else
// set RFM69 SPI settings explicitly
SPI.setDataMode(SPI_MODE0);
SPI.setBitOrder(MSBFIRST);
#ifdef __arm__
SPI.setClockDivider(SPI_CLOCK_DIV16);
#else
SPI.setClockDivider(SPI_CLOCK_DIV4); // decided to slow down from DIV2 after SPI stalling in some instances, especially visible on mega1284p when RFM69 and FLASH chip both present
#endif
#endif
digitalWrite(_slaveSelectPin, LOW);
}