mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 16:25:31 +03:00
Disable USE_BARO_{BMP280,MS5611} if not USE_I2C
This commit is contained in:
parent
ba553a3036
commit
ecc66cb2d4
2 changed files with 11 additions and 5 deletions
|
@ -138,11 +138,6 @@ bool bmp280Detect(baroDev_t *baro)
|
|||
|
||||
bmp280ReadRegister(pBusdev, BMP280_CHIP_ID_REG, 1, &bmp280_chip_id); /* read Chip Id */
|
||||
|
||||
debug[0]++;
|
||||
debug[1] = pBusdev->bustype;
|
||||
debug[2] = spiDeviceByInstance(pBusdev->busdev_u.spi.instance);
|
||||
debug[3] = pBusdev->busdev_u.spi.csnPin;
|
||||
|
||||
if (bmp280_chip_id != BMP280_DEFAULT_CHIP_ID) {
|
||||
bmp280BusDeinit(pBusdev);
|
||||
return false;
|
||||
|
|
|
@ -39,3 +39,14 @@
|
|||
#define USE_I2C_OLED_DISPLAY
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// XXX Remove USE_BARO_BMP280 and USE_BARO_MS5611 if USE_I2C is not defined.
|
||||
// XXX This should go away buy editing relevant target.h files
|
||||
#if !defined(USE_I2C)
|
||||
#if defined(USE_BARO_BMP280)
|
||||
#undef USE_BARO_BMP280
|
||||
#endif
|
||||
#if defined(USE_BARO_MS5611)
|
||||
#undef USE_BARO_MS5611
|
||||
#endif
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue