Airspeed: Move to 0-based index

This commit is contained in:
Lorenz Meier
2015-02-03 13:44:22 +01:00
parent 3036ad034d
commit 6e4b95e844
3 changed files with 10 additions and 10 deletions
+2 -2
View File
@@ -106,7 +106,7 @@ Airspeed::~Airspeed()
stop();
if (_class_instance != -1)
unregister_class_devname(AIRSPEED_DEVICE_PATH, _class_instance);
unregister_class_devname(AIRSPEED_BASE_DEVICE_PATH, _class_instance);
/* free any existing reports */
if (_reports != nullptr)
@@ -133,7 +133,7 @@ Airspeed::init()
goto out;
/* register alternate interfaces if we have to */
_class_instance = register_class_devname(AIRSPEED_DEVICE_PATH);
_class_instance = register_class_devname(AIRSPEED_BASE_DEVICE_PATH);
/* publication init */
if (_class_instance == CLASS_DEVICE_PRIMARY) {
+4 -4
View File
@@ -300,7 +300,7 @@ start(int i2c_bus)
goto fail;
/* set the poll rate to default, starts automatic data collection */
fd = open(AIRSPEED_DEVICE_PATH, O_RDONLY);
fd = open(AIRSPEED0_DEVICE_PATH, O_RDONLY);
if (fd < 0)
goto fail;
@@ -349,10 +349,10 @@ test()
ssize_t sz;
int ret;
int fd = open(AIRSPEED_DEVICE_PATH, O_RDONLY);
int fd = open(ETS_PATH, O_RDONLY);
if (fd < 0)
err(1, "%s open failed (try 'ets_airspeed start' if the driver is not running", AIRSPEED_DEVICE_PATH);
err(1, "%s open failed (try 'ets_airspeed start' if the driver is not running", ETS_PATH);
/* do a simple demand read */
sz = read(fd, &report, sizeof(report));
@@ -402,7 +402,7 @@ test()
void
reset()
{
int fd = open(AIRSPEED_DEVICE_PATH, O_RDONLY);
int fd = open(ETS_PATH, O_RDONLY);
if (fd < 0)
err(1, "failed ");
+4 -4
View File
@@ -437,7 +437,7 @@ start(int i2c_bus)
}
/* set the poll rate to default, starts automatic data collection */
fd = open(AIRSPEED_DEVICE_PATH, O_RDONLY);
fd = open(PATH_MS4525, O_RDONLY);
if (fd < 0) {
goto fail;
@@ -488,10 +488,10 @@ test()
ssize_t sz;
int ret;
int fd = open(AIRSPEED_DEVICE_PATH, O_RDONLY);
int fd = open(PATH_MS4525, O_RDONLY);
if (fd < 0) {
err(1, "%s open failed (try 'meas_airspeed start' if the driver is not running", AIRSPEED_DEVICE_PATH);
err(1, "%s open failed (try 'meas_airspeed start' if the driver is not running", PATH_MS4525);
}
/* do a simple demand read */
@@ -548,7 +548,7 @@ test()
void
reset()
{
int fd = open(AIRSPEED_DEVICE_PATH, O_RDONLY);
int fd = open(PATH_MS4525, O_RDONLY);
if (fd < 0) {
err(1, "failed ");