diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-07-16 15:26:22 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-07-16 15:26:22 +0200 |
commit | c5e4f33bb33689df5acb26ee4f40c70496f9b1eb (patch) | |
tree | 381976022f870a4543281589e7d42b67ad76926d /src/drivers/mpu6000/mpu6000.cpp | |
parent | ca98070f8b479f5d643d810a077ad09e84d32721 (diff) | |
parent | 654aaa0ca852b95e4e2bec5cf9b77ca3242d1d63 (diff) | |
download | px4-firmware-c5e4f33bb33689df5acb26ee4f40c70496f9b1eb.tar.gz px4-firmware-c5e4f33bb33689df5acb26ee4f40c70496f9b1eb.tar.bz2 px4-firmware-c5e4f33bb33689df5acb26ee4f40c70496f9b1eb.zip |
Merge sensor_startup_cleanup
Diffstat (limited to 'src/drivers/mpu6000/mpu6000.cpp')
-rw-r--r-- | src/drivers/mpu6000/mpu6000.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/drivers/mpu6000/mpu6000.cpp b/src/drivers/mpu6000/mpu6000.cpp index 09eec0caf..6f5dae7ad 100644 --- a/src/drivers/mpu6000/mpu6000.cpp +++ b/src/drivers/mpu6000/mpu6000.cpp @@ -344,6 +344,9 @@ private: */ void _set_sample_rate(uint16_t desired_sample_rate_hz); + /* do not allow to copy this class due to pointer data members */ + MPU6000(const MPU6000&); + MPU6000 operator=(const MPU6000&); }; /** @@ -371,6 +374,9 @@ private: orb_id_t _gyro_orb_id; int _gyro_class_instance; + /* do not allow to copy this class due to pointer data members */ + MPU6000_gyro(const MPU6000_gyro&); + MPU6000_gyro operator=(const MPU6000_gyro&); }; /** driver 'main' command */ @@ -380,14 +386,17 @@ MPU6000::MPU6000(int bus, const char *path_accel, const char *path_gyro, spi_dev SPI("MPU6000", path_accel, bus, device, SPIDEV_MODE3, MPU6000_LOW_BUS_SPEED), _gyro(new MPU6000_gyro(this, path_gyro)), _product(0), + _call{}, _call_interval(0), _accel_reports(nullptr), + _accel_scale{}, _accel_range_scale(0.0f), _accel_range_m_s2(0.0f), _accel_topic(-1), _accel_orb_id(nullptr), _accel_class_instance(-1), _gyro_reports(nullptr), + _gyro_scale{}, _gyro_range_scale(0.0f), _gyro_range_rad_s(0.0f), _sample_rate(1000), @@ -1466,6 +1475,9 @@ void usage(); /** * Start the driver. + * + * This function only returns if the driver is up and running + * or failed to detect the sensor. */ void start(bool external_bus, enum Rotation rotation) @@ -1536,7 +1548,7 @@ test(bool external_bus) int fd = open(path_accel, O_RDONLY); if (fd < 0) - err(1, "%s open failed (try 'mpu6000 start' if the driver is not running)", + err(1, "%s open failed (try 'mpu6000 start')", path_accel); /* get the driver */ |