Board drivers: Move to 0-based index

This commit is contained in:
Lorenz Meier
2015-02-03 13:46:34 +01:00
parent 2bf0092282
commit fac158f7e5
3 changed files with 9 additions and 9 deletions
+5 -5
View File
@@ -177,7 +177,7 @@ private:
extern "C" __EXPORT int px4flow_main(int argc, char *argv[]);
PX4FLOW::PX4FLOW(int bus, int address, enum Rotation rotation) :
I2C("PX4FLOW", PX4FLOW_DEVICE_PATH, bus, address, PX4FLOW_I2C_MAX_BUS_SPEED), /* 100-400 KHz */
I2C("PX4FLOW", PX4FLOW0_DEVICE_PATH, bus, address, PX4FLOW_I2C_MAX_BUS_SPEED), /* 100-400 KHz */
_reports(nullptr),
_sensor_ok(false),
_measure_ticks(0),
@@ -655,7 +655,7 @@ start()
}
/* set the poll rate to default, starts automatic data collection */
fd = open(PX4FLOW_DEVICE_PATH, O_RDONLY);
fd = open(PX4FLOW0_DEVICE_PATH, O_RDONLY);
if (fd < 0) {
goto fail;
@@ -706,10 +706,10 @@ test()
ssize_t sz;
int ret;
int fd = open(PX4FLOW_DEVICE_PATH, O_RDONLY);
int fd = open(PX4FLOW0_DEVICE_PATH, O_RDONLY);
if (fd < 0) {
err(1, "%s open failed (try 'px4flow start' if the driver is not running", PX4FLOW_DEVICE_PATH);
err(1, "%s open failed (try 'px4flow start' if the driver is not running", PX4FLOW0_DEVICE_PATH);
}
@@ -782,7 +782,7 @@ test()
void
reset()
{
int fd = open(PX4FLOW_DEVICE_PATH, O_RDONLY);
int fd = open(PX4FLOW0_DEVICE_PATH, O_RDONLY);
if (fd < 0) {
err(1, "failed ");
+2 -2
View File
@@ -306,7 +306,7 @@ PX4FMU::~PX4FMU()
}
/* clean up the alternate device node */
unregister_class_devname(PWM_OUTPUT_DEVICE_PATH, _class_instance);
unregister_class_devname(PWM_OUTPUT_BASE_DEVICE_PATH, _class_instance);
g_fmu = nullptr;
}
@@ -325,7 +325,7 @@ PX4FMU::init()
return ret;
/* try to claim the generic PWM output device node as well - it's OK if we fail at this */
_class_instance = register_class_devname(PWM_OUTPUT_DEVICE_PATH);
_class_instance = register_class_devname(PWM_OUTPUT_BASE_DEVICE_PATH);
if (_class_instance == CLASS_DEVICE_PRIMARY) {
log("default PWM output device");
+2 -2
View File
@@ -830,7 +830,7 @@ PX4IO::init()
}
/* try to claim the generic PWM output device node as well - it's OK if we fail at this */
ret = register_driver(PWM_OUTPUT_DEVICE_PATH, &fops, 0666, (void *)this);
ret = register_driver(PWM_OUTPUT0_DEVICE_PATH, &fops, 0666, (void *)this);
if (ret == OK) {
log("default PWM output device");
@@ -1080,7 +1080,7 @@ out:
/* clean up the alternate device node */
if (_primary_pwm_device)
unregister_driver(PWM_OUTPUT_DEVICE_PATH);
unregister_driver(PWM_OUTPUT0_DEVICE_PATH);
/* tell the dtor that we are exiting */
_task = -1;