aboutsummaryrefslogtreecommitdiff
path: root/apps/drivers/l3gd20/l3gd20.cpp
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2012-11-23 22:52:37 +0100
committerLorenz Meier <lm@inf.ethz.ch>2012-11-23 22:52:37 +0100
commitb1bc5e0e461856ca8f1cc532eb2023ddbe2cb957 (patch)
treee56b7ced5928fac51c83754652a105529c38979c /apps/drivers/l3gd20/l3gd20.cpp
parent0193d590db92b96e93de9594b7db75a2c7805de6 (diff)
downloadpx4-firmware-b1bc5e0e461856ca8f1cc532eb2023ddbe2cb957.tar.gz
px4-firmware-b1bc5e0e461856ca8f1cc532eb2023ddbe2cb957.tar.bz2
px4-firmware-b1bc5e0e461856ca8f1cc532eb2023ddbe2cb957.zip
Improved drivers, allowed parallel use of multiple gyros
Diffstat (limited to 'apps/drivers/l3gd20/l3gd20.cpp')
-rw-r--r--apps/drivers/l3gd20/l3gd20.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/drivers/l3gd20/l3gd20.cpp b/apps/drivers/l3gd20/l3gd20.cpp
index 4915b81e3..f2f585f42 100644
--- a/apps/drivers/l3gd20/l3gd20.cpp
+++ b/apps/drivers/l3gd20/l3gd20.cpp
@@ -151,7 +151,7 @@ extern "C" { __EXPORT int l3gd20_main(int argc, char *argv[]); }
class L3GD20 : public device::SPI
{
public:
- L3GD20(int bus, spi_dev_e device);
+ L3GD20(int bus, const char* path, spi_dev_e device);
~L3GD20();
virtual int init();
@@ -265,8 +265,8 @@ private:
#define INCREMENT(_x, _lim) do { _x++; if (_x >= _lim) _x = 0; } while(0)
-L3GD20::L3GD20(int bus, spi_dev_e device) :
- SPI("L3GD20", GYRO_DEVICE_PATH, bus, device, SPIDEV_MODE3, 8000000),
+L3GD20::L3GD20(int bus, const char* path, spi_dev_e device) :
+ SPI("L3GD20", path, bus, device, SPIDEV_MODE3, 8000000),
_call_interval(0),
_num_reports(0),
_next_report(0),
@@ -745,7 +745,7 @@ start()
errx(1, "already started");
/* create the driver */
- g_dev = new L3GD20(1 /* XXX magic number */, (spi_dev_e)PX4_SPIDEV_GYRO);
+ g_dev = new L3GD20(1 /* XXX magic number */, GYRO_DEVICE_PATH, (spi_dev_e)PX4_SPIDEV_GYRO);
if (g_dev == nullptr)
goto fail;