Merge branch 'beta' into beta_mavlink

This commit is contained in:
Julian Oes
2014-02-15 21:36:46 +01:00
4 changed files with 14 additions and 11 deletions
+2 -2
View File
@@ -76,8 +76,8 @@
#include <drivers/airspeed/airspeed.h> #include <drivers/airspeed/airspeed.h>
Airspeed::Airspeed(int bus, int address, unsigned conversion_interval) : Airspeed::Airspeed(int bus, int address, unsigned conversion_interval, const char* path) :
I2C("Airspeed", AIRSPEED_DEVICE_PATH, bus, address, 100000), I2C("Airspeed", path, bus, address, 100000),
_reports(nullptr), _reports(nullptr),
_buffer_overflows(perf_alloc(PC_COUNT, "airspeed_buffer_overflows")), _buffer_overflows(perf_alloc(PC_COUNT, "airspeed_buffer_overflows")),
_max_differential_pressure_pa(0), _max_differential_pressure_pa(0),
+1 -1
View File
@@ -90,7 +90,7 @@ static const int ERROR = -1;
class __EXPORT Airspeed : public device::I2C class __EXPORT Airspeed : public device::I2C
{ {
public: public:
Airspeed(int bus, int address, unsigned conversion_interval); Airspeed(int bus, int address, unsigned conversion_interval, const char* path);
virtual ~Airspeed(); virtual ~Airspeed();
virtual int init(); virtual int init();
+4 -3
View File
@@ -77,6 +77,7 @@
/* I2C bus address */ /* I2C bus address */
#define I2C_ADDRESS 0x75 /* 7-bit address. 8-bit address is 0xEA */ #define I2C_ADDRESS 0x75 /* 7-bit address. 8-bit address is 0xEA */
#define ETS_PATH "/dev/ets_airspeed"
/* Register address */ /* Register address */
#define READ_CMD 0x07 /* Read the data */ #define READ_CMD 0x07 /* Read the data */
@@ -93,7 +94,7 @@
class ETSAirspeed : public Airspeed class ETSAirspeed : public Airspeed
{ {
public: public:
ETSAirspeed(int bus, int address = I2C_ADDRESS); ETSAirspeed(int bus, int address = I2C_ADDRESS, const char* path = ETS_PATH);
protected: protected:
@@ -112,8 +113,8 @@ protected:
*/ */
extern "C" __EXPORT int ets_airspeed_main(int argc, char *argv[]); extern "C" __EXPORT int ets_airspeed_main(int argc, char *argv[]);
ETSAirspeed::ETSAirspeed(int bus, int address) : Airspeed(bus, address, ETSAirspeed::ETSAirspeed(int bus, int address, const char* path) : Airspeed(bus, address,
CONVERSION_INTERVAL) CONVERSION_INTERVAL, path)
{ {
} }
+7 -5
View File
@@ -89,8 +89,10 @@
/* I2C bus address is 1010001x */ /* I2C bus address is 1010001x */
#define I2C_ADDRESS_MS4525DO 0x28 //0x51 /* 7-bit address. */ #define I2C_ADDRESS_MS4525DO 0x28 //0x51 /* 7-bit address. */
#define PATH_MS4525 "/dev/ms4525"
/* The MS5525DSO address is 111011Cx, where C is the complementary value of the pin CSB */ /* The MS5525DSO address is 111011Cx, where C is the complementary value of the pin CSB */
#define I2C_ADDRESS_MS5525DSO 0x77 //0x77/* 7-bit address, addr. pin pulled low */ #define I2C_ADDRESS_MS5525DSO 0x77 //0x77/* 7-bit address, addr. pin pulled low */
#define PATH_MS5525 "/dev/ms5525"
/* Register address */ /* Register address */
#define ADDR_READ_MR 0x00 /* write to this address to start conversion */ #define ADDR_READ_MR 0x00 /* write to this address to start conversion */
@@ -101,7 +103,7 @@
class MEASAirspeed : public Airspeed class MEASAirspeed : public Airspeed
{ {
public: public:
MEASAirspeed(int bus, int address = I2C_ADDRESS_MS4525DO); MEASAirspeed(int bus, int address = I2C_ADDRESS_MS4525DO, const char* path = PATH_MS4525);
protected: protected:
@@ -120,8 +122,8 @@ protected:
*/ */
extern "C" __EXPORT int meas_airspeed_main(int argc, char *argv[]); extern "C" __EXPORT int meas_airspeed_main(int argc, char *argv[]);
MEASAirspeed::MEASAirspeed(int bus, int address) : Airspeed(bus, address, MEASAirspeed::MEASAirspeed(int bus, int address, const char* path) : Airspeed(bus, address,
CONVERSION_INTERVAL) CONVERSION_INTERVAL, path)
{ {
} }
@@ -304,7 +306,7 @@ start(int i2c_bus)
errx(1, "already started"); errx(1, "already started");
/* create the driver, try the MS4525DO first */ /* create the driver, try the MS4525DO first */
g_dev = new MEASAirspeed(i2c_bus, I2C_ADDRESS_MS4525DO); g_dev = new MEASAirspeed(i2c_bus, I2C_ADDRESS_MS4525DO, PATH_MS4525);
/* check if the MS4525DO was instantiated */ /* check if the MS4525DO was instantiated */
if (g_dev == nullptr) if (g_dev == nullptr)
@@ -313,7 +315,7 @@ start(int i2c_bus)
/* try the MS5525DSO next if init fails */ /* try the MS5525DSO next if init fails */
if (OK != g_dev->Airspeed::init()) { if (OK != g_dev->Airspeed::init()) {
delete g_dev; delete g_dev;
g_dev = new MEASAirspeed(i2c_bus, I2C_ADDRESS_MS5525DSO); g_dev = new MEASAirspeed(i2c_bus, I2C_ADDRESS_MS5525DSO, PATH_MS5525);
/* check if the MS5525DSO was instantiated */ /* check if the MS5525DSO was instantiated */
if (g_dev == nullptr) if (g_dev == nullptr)