From 1e4113ee37d63ecc86d0648e6b4c2d512afdce17 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Wed, 3 May 2017 15:42:22 -1000 Subject: [PATCH] lsm303d:spi_dev_e is now uint32_t in NuttX Using new type of uint32_t for spi device --- src/drivers/lsm303d/lsm303d.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/drivers/lsm303d/lsm303d.cpp b/src/drivers/lsm303d/lsm303d.cpp index 5e7a9819fd..5f277d4486 100644 --- a/src/drivers/lsm303d/lsm303d.cpp +++ b/src/drivers/lsm303d/lsm303d.cpp @@ -230,7 +230,7 @@ class LSM303D_mag; class LSM303D : public device::SPI { public: - LSM303D(int bus, const char *path, spi_dev_e device, enum Rotation rotation); + LSM303D(int bus, const char *path, uint32_t device, enum Rotation rotation); virtual ~LSM303D(); virtual int init(); @@ -544,7 +544,7 @@ private: }; -LSM303D::LSM303D(int bus, const char *path, spi_dev_e device, enum Rotation rotation) : +LSM303D::LSM303D(int bus, const char *path, uint32_t device, enum Rotation rotation) : SPI("LSM303D", path, bus, device, SPIDEV_MODE3, 11 * 1000 * 1000 /* will be rounded to 10.4 MHz, within safety margins for LSM303D */), _mag(new LSM303D_mag(this)), @@ -1913,13 +1913,13 @@ start(bool external_bus, enum Rotation rotation, unsigned range) /* create the driver */ if (external_bus) { #if defined(PX4_SPI_BUS_EXT) && defined(PX4_SPIDEV_EXT_ACCEL_MAG) - g_dev = new LSM303D(PX4_SPI_BUS_EXT, LSM303D_DEVICE_PATH_ACCEL, (spi_dev_e)PX4_SPIDEV_EXT_ACCEL_MAG, rotation); + g_dev = new LSM303D(PX4_SPI_BUS_EXT, LSM303D_DEVICE_PATH_ACCEL, PX4_SPIDEV_EXT_ACCEL_MAG, rotation); #else errx(0, "External SPI not available"); #endif } else { - g_dev = new LSM303D(PX4_SPI_BUS_SENSORS, LSM303D_DEVICE_PATH_ACCEL, (spi_dev_e)PX4_SPIDEV_ACCEL_MAG, rotation); + g_dev = new LSM303D(PX4_SPI_BUS_SENSORS, LSM303D_DEVICE_PATH_ACCEL, PX4_SPIDEV_ACCEL_MAG, rotation); } if (g_dev == nullptr) {