Skip to content

Commit 1049246

Browse files
committed
Make sure SPI backend is initialized in SPIFlash driver
In some cases, SPIFlash driver hangs during initialization because it reads data from the SPI backend. But if SPI backend has not been initialized, this fails.
1 parent 10e4859 commit 1049246

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

libraries/MySensors/utility/SPIFlash.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ void SPIFlash::unselect() {
5656
/// setup SPI, read device ID etc...
5757
boolean SPIFlash::initialize()
5858
{
59+
SPI.begin();
5960
_SPCR = SPCR;
6061
_SPSR = SPSR;
6162
pinMode(_slaveSelectPin, OUTPUT);

0 commit comments

Comments
 (0)