diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/drivers/hmc5883/hmc5883.cpp | 11 | ||||
-rw-r--r-- | apps/drivers/ms5611/ms5611.cpp | 6 | ||||
-rw-r--r-- | apps/drivers/stm32/tone_alarm/tone_alarm.cpp | 2 |
3 files changed, 10 insertions, 9 deletions
diff --git a/apps/drivers/hmc5883/hmc5883.cpp b/apps/drivers/hmc5883/hmc5883.cpp index 7943012cc..f9079c3ff 100644 --- a/apps/drivers/hmc5883/hmc5883.cpp +++ b/apps/drivers/hmc5883/hmc5883.cpp @@ -58,17 +58,21 @@ #include <nuttx/wqueue.h> #include <nuttx/clock.h> -#include <drivers/drv_hrt.h> +#include <arch/board/board.h> #include <systemlib/perf_counter.h> #include <systemlib/err.h> #include <drivers/drv_mag.h> +#include <drivers/drv_hrt.h> /* * HMC5883 internal constants and data structures. */ +#define HMC5883L_BUS PX4_I2C_BUS_ONBOARD +#define HMC5883L_ADDRESS PX4_I2C_OBDEV_HMC5883 + /* Max measurement rate is 160Hz */ #define HMC5883_CONVERSION_INTERVAL (1000000 / 160) /* microseconds */ @@ -86,8 +90,6 @@ #define ADDR_ID_B 0x0b #define ADDR_ID_C 0x0c -#define HMC5883L_ADDRESS 0x1E - /* modes not changeable outside of driver */ #define HMC5883L_MODE_NORMAL (0 << 0) /* default */ #define HMC5883L_MODE_POSITIVE_BIAS (1 << 0) /* positive bias */ @@ -1100,8 +1102,7 @@ start() errx(1, "already started"); /* create the driver */ - /* XXX HORRIBLE hack - the bus number should not come from here */ - g_dev = new HMC5883(2); + g_dev = new HMC5883(HMC5883L_BUS); if (g_dev == nullptr) goto fail; diff --git a/apps/drivers/ms5611/ms5611.cpp b/apps/drivers/ms5611/ms5611.cpp index 699cd36d2..211c07728 100644 --- a/apps/drivers/ms5611/ms5611.cpp +++ b/apps/drivers/ms5611/ms5611.cpp @@ -240,7 +240,8 @@ private: #define MS5611_CONVERSION_INTERVAL 10000 /* microseconds */ #define MS5611_MEASUREMENT_RATIO 3 /* pressure measurements per temperature measurement */ -#define MS5611_ADDRESS_1 0x76 /* address select pins pulled high (PX4FMU series v1.6+) */ +#define MS5611_BUS PX4_I2C_BUS_ONBOARD +#define MS5611_ADDRESS_1 PX4_I2C_OBDEV_MS5611 /* address select pins pulled high (PX4FMU series v1.6+) */ #define MS5611_ADDRESS_2 0x77 /* address select pins pulled low (PX4FMU prototypes) */ #define ADDR_RESET_CMD 0x1E /* write to this address to reset chip */ @@ -937,8 +938,7 @@ start() errx(1, "already started"); /* create the driver */ - /* XXX HORRIBLE hack - the bus number should not come from here */ - g_dev = new MS5611(2); + g_dev = new MS5611(MS5611_BUS); if (g_dev == nullptr) goto fail; diff --git a/apps/drivers/stm32/tone_alarm/tone_alarm.cpp b/apps/drivers/stm32/tone_alarm/tone_alarm.cpp index 03cf3ee5d..cb1d567d1 100644 --- a/apps/drivers/stm32/tone_alarm/tone_alarm.cpp +++ b/apps/drivers/stm32/tone_alarm/tone_alarm.cpp @@ -84,7 +84,7 @@ #include <systemlib/err.h> #ifndef CONFIG_HRT_TIMER -# error CONFIG_TONE_ALARM requires CONFIG_HRT_TIMER +# error This driver requires CONFIG_HRT_TIMER #endif /* Tone alarm configuration */ |