mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-31 19:01:38 +08:00
i2c_spi_buses: respect CONFIG_I2C and CONFIG_SPI
- bmp280, dps310, and ms5611 barometers support boards without I2C
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
|
||||
#include <px4_platform_common/i2c.h>
|
||||
|
||||
#if defined(CONFIG_I2C)
|
||||
|
||||
static inline constexpr px4_i2c_bus_t initI2CBusInternal(int bus)
|
||||
{
|
||||
@@ -51,3 +52,4 @@ static inline constexpr px4_i2c_bus_t initI2CBusExternal(int bus)
|
||||
ret.is_external = true;
|
||||
return ret;
|
||||
}
|
||||
#endif // CONFIG_I2C
|
||||
|
||||
@@ -35,6 +35,8 @@
|
||||
|
||||
#include <px4_platform_common/spi.h>
|
||||
|
||||
#if defined(CONFIG_SPI)
|
||||
|
||||
static inline constexpr px4_spi_bus_device_t initSPIDevice(uint8_t devid_driver, uint8_t cs_index)
|
||||
{
|
||||
px4_spi_bus_device_t ret{};
|
||||
@@ -57,3 +59,4 @@ static inline constexpr px4_spi_bus_t initSPIBus(int bus, const px4_spi_bus_devi
|
||||
ret.requires_locking = false;
|
||||
return ret;
|
||||
}
|
||||
#endif // CONFIG_SPI
|
||||
|
||||
Reference in New Issue
Block a user