Move SPI.begin() per Issue#20
https://github.com/LowPowerLab/SPIFlash/issues/20
This commit is contained in:
parent
09f09b923c
commit
eec4aa34b2
|
|
@ -68,7 +68,6 @@ void SPIFlash::select() {
|
|||
SPI.setDataMode(SPI_MODE0);
|
||||
SPI.setBitOrder(MSBFIRST);
|
||||
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
|
||||
SPI.begin();
|
||||
#endif
|
||||
digitalWrite(_slaveSelectPin, LOW);
|
||||
}
|
||||
|
|
@ -96,6 +95,7 @@ boolean SPIFlash::initialize()
|
|||
_SPSR = SPSR;
|
||||
#endif
|
||||
pinMode(_slaveSelectPin, OUTPUT);
|
||||
SPI.begin();
|
||||
#ifdef SPI_HAS_TRANSACTION
|
||||
_settings = SPISettings(4000000, MSBFIRST, SPI_MODE0);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue