aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/mpu6000
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2014-07-16 08:58:18 +0200
committerLorenz Meier <lm@inf.ethz.ch>2014-07-16 08:58:18 +0200
commit164b4ef4ce7e4452e92a3854a51b025f45319e59 (patch)
tree7c142411f3cb52597ccbf2c5c90ae61e6afaf9bb /src/drivers/mpu6000
parent7ca184de45a49ca2bde5733a54843975e193a237 (diff)
downloadpx4-firmware-164b4ef4ce7e4452e92a3854a51b025f45319e59.tar.gz
px4-firmware-164b4ef4ce7e4452e92a3854a51b025f45319e59.tar.bz2
px4-firmware-164b4ef4ce7e4452e92a3854a51b025f45319e59.zip
MPU6K: Cleaner init
Diffstat (limited to 'src/drivers/mpu6000')
-rw-r--r--src/drivers/mpu6000/module.mk2
-rw-r--r--src/drivers/mpu6000/mpu6000.cpp9
2 files changed, 11 insertions, 0 deletions
diff --git a/src/drivers/mpu6000/module.mk b/src/drivers/mpu6000/module.mk
index 6087e1509..5b4893b12 100644
--- a/src/drivers/mpu6000/module.mk
+++ b/src/drivers/mpu6000/module.mk
@@ -40,3 +40,5 @@ MODULE_COMMAND = mpu6000
SRCS = mpu6000.cpp
MODULE_STACKSIZE = 1200
+
+EXTRACXXFLAGS = -Weffc++
diff --git a/src/drivers/mpu6000/mpu6000.cpp b/src/drivers/mpu6000/mpu6000.cpp
index 442f0a37c..db9d4d7e1 100644
--- a/src/drivers/mpu6000/mpu6000.cpp
+++ b/src/drivers/mpu6000/mpu6000.cpp
@@ -343,6 +343,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&);
};
/**
@@ -369,6 +372,9 @@ private:
orb_advert_t _gyro_topic;
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 */
@@ -378,13 +384,16 @@ 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_class_instance(-1),
_gyro_reports(nullptr),
+ _gyro_scale{},
_gyro_range_scale(0.0f),
_gyro_range_rad_s(0.0f),
_sample_rate(1000),