From 44a07e7084fdb50bc38ac902e62ef4e9491140e4 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Wed, 3 May 2017 15:42:21 -1000 Subject: [PATCH] l3gd20:spi_dev_e is now uint32_t in NuttX Using new type of uint32_t for spi device --- src/drivers/l3gd20/l3gd20.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/drivers/l3gd20/l3gd20.cpp b/src/drivers/l3gd20/l3gd20.cpp index c2b059ec1d..d26216ec0a 100644 --- a/src/drivers/l3gd20/l3gd20.cpp +++ b/src/drivers/l3gd20/l3gd20.cpp @@ -201,7 +201,7 @@ extern "C" { __EXPORT int l3gd20_main(int argc, char *argv[]); } class L3GD20 : public device::SPI { public: - L3GD20(int bus, const char *path, spi_dev_e device, enum Rotation rotation); + L3GD20(int bus, const char *path, uint32_t device, enum Rotation rotation); virtual ~L3GD20(); virtual int init(); @@ -405,7 +405,7 @@ const uint8_t L3GD20::_checked_registers[L3GD20_NUM_CHECKED_REGISTERS] = { ADDR_ ADDR_LOW_ODR }; -L3GD20::L3GD20(int bus, const char *path, spi_dev_e device, enum Rotation rotation) : +L3GD20::L3GD20(int bus, const char *path, uint32_t device, enum Rotation rotation) : SPI("L3GD20", path, bus, device, SPIDEV_MODE3, 11 * 1000 * 1000 /* will be rounded to 10.4 MHz, within margins for L3GD20 */), _call{}, @@ -1206,13 +1206,13 @@ start(bool external_bus, enum Rotation rotation) /* create the driver */ if (external_bus) { #if defined(PX4_SPI_BUS_EXT) && defined(PX4_SPIDEV_EXT_GYRO) - g_dev = new L3GD20(PX4_SPI_BUS_EXT, L3GD20_DEVICE_PATH, (spi_dev_e)PX4_SPIDEV_EXT_GYRO, rotation); + g_dev = new L3GD20(PX4_SPI_BUS_EXT, L3GD20_DEVICE_PATH, PX4_SPIDEV_EXT_GYRO, rotation); #else errx(0, "External SPI not available"); #endif } else { - g_dev = new L3GD20(PX4_SPI_BUS_SENSORS, L3GD20_DEVICE_PATH, (spi_dev_e)PX4_SPIDEV_GYRO, rotation); + g_dev = new L3GD20(PX4_SPI_BUS_SENSORS, L3GD20_DEVICE_PATH, PX4_SPIDEV_GYRO, rotation); } if (g_dev == nullptr) {