mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-05 13:08:53 +08:00
bmi160:spi_dev_e is now uint32_t in NuttX
Using new type of uint32_t for spi device
This commit is contained in:
committed by
Daniel Agar
parent
045771ffcb
commit
a5ea55cc5c
@@ -18,7 +18,7 @@ const uint8_t BMI160::_checked_registers[BMI160_NUM_CHECKED_REGISTERS] = { BM
|
||||
BMIREG_NV_CONF
|
||||
};
|
||||
|
||||
BMI160::BMI160(int bus, const char *path_accel, const char *path_gyro, spi_dev_e device, enum Rotation rotation) :
|
||||
BMI160::BMI160(int bus, const char *path_accel, const char *path_gyro, uint32_t device, enum Rotation rotation) :
|
||||
SPI("BMI160", path_accel, bus, device, SPIDEV_MODE3, BMI160_BUS_SPEED),
|
||||
_gyro(new BMI160_gyro(this, path_gyro)),
|
||||
_whoami(0),
|
||||
|
||||
@@ -256,7 +256,7 @@ class BMI160_gyro;
|
||||
class BMI160 : public device::SPI
|
||||
{
|
||||
public:
|
||||
BMI160(int bus, const char *path_accel, const char *path_gyro, spi_dev_e device, enum Rotation rotation);
|
||||
BMI160(int bus, const char *path_accel, const char *path_gyro, uint32_t device, enum Rotation rotation);
|
||||
virtual ~BMI160();
|
||||
|
||||
virtual int init();
|
||||
|
||||
@@ -48,14 +48,14 @@ start(bool external_bus, enum Rotation rotation)
|
||||
/* create the driver */
|
||||
if (external_bus) {
|
||||
#if defined(PX4_SPI_BUS_EXT) && defined(PX4_SPIDEV_EXT_BMI)
|
||||
*g_dev_ptr = new BMI160(PX4_SPI_BUS_EXT, path_accel, path_gyro, (spi_dev_e)PX4_SPIDEV_EXT_BMI, rotation);
|
||||
*g_dev_ptr = new BMI160(PX4_SPI_BUS_EXT, path_accel, path_gyro, PX4_SPIDEV_EXT_BMI, rotation);
|
||||
#else
|
||||
errx(0, "External SPI not available");
|
||||
#endif
|
||||
|
||||
} else {
|
||||
#if defined(PX4_SPIDEV_BMI)
|
||||
*g_dev_ptr = new BMI160(PX4_SPI_BUS_SENSORS, path_accel, path_gyro, (spi_dev_e)PX4_SPIDEV_BMI, rotation);
|
||||
*g_dev_ptr = new BMI160(PX4_SPI_BUS_SENSORS, path_accel, path_gyro, PX4_SPIDEV_BMI, rotation);
|
||||
#else
|
||||
errx(0, "No Internal SPI CS");
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user