Merge pull request #7723 from jflyper/bfdev-fix-lps-driver-hardfaulting-on-non-SPI-detect-call
[BARO, LPS] Don't fiddle with SPI if the device is not on SPI bus
This commit is contained in:
commit
f6cef94b28
|
@ -252,6 +252,11 @@ bool lpsDetect(baroDev_t *baro)
|
|||
{
|
||||
//Detect
|
||||
busDevice_t *busdev = &baro->busdev;
|
||||
|
||||
if (busdev->bustype != BUSTYPE_SPI) {
|
||||
return false;
|
||||
}
|
||||
|
||||
IOInit(busdev->busdev_u.spi.csnPin, OWNER_BARO_CS, 0);
|
||||
IOConfigGPIO(busdev->busdev_u.spi.csnPin, IOCFG_OUT_PP);
|
||||
IOHi(busdev->busdev_u.spi.csnPin); // Disable
|
||||
|
|
Loading…
Reference in New Issue