Skip to content

Commit bfb5b96

Browse files
authored
Merge pull request #3 from lkolbly/master
Don't enable SPI bus when SPI mode is disabled.
2 parents 77d2d2f + 6b74349 commit bfb5b96

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/MPU9250.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ void MPU9250::initAK8963(float * destination)
209209
writeByte(AK8963_ADDRESS, AK8963_CNTL, Mscale << 4 | Mmode);
210210
delay(10);
211211

212-
if(_csPin == NOT_SPI)
212+
if(_csPin != NOT_SPI)
213213
{
214214
setupMagForSPI();
215215
}
@@ -291,7 +291,7 @@ void MPU9250::initMPU9250()
291291
writeByte(_I2Caddr, INT_ENABLE, 0x01);
292292
delay(100);
293293

294-
if(_csPin == NOT_SPI)
294+
if(_csPin != NOT_SPI)
295295
{
296296
setupMagForSPI();
297297
}

0 commit comments

Comments
 (0)