|
|
|
@ -255,7 +255,7 @@ MB12XX::init()
@@ -255,7 +255,7 @@ MB12XX::init()
|
|
|
|
|
|
|
|
|
|
/* do I2C init (and probe) first */ |
|
|
|
|
if (I2C::init() != OK) { |
|
|
|
|
goto out; |
|
|
|
|
return ret; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* allocate basic report buffers */ |
|
|
|
@ -265,13 +265,13 @@ MB12XX::init()
@@ -265,13 +265,13 @@ MB12XX::init()
|
|
|
|
|
set_address(_index_counter); /* set I2c port to temp sonar i2c adress */ |
|
|
|
|
|
|
|
|
|
if (_reports == nullptr) { |
|
|
|
|
goto out; |
|
|
|
|
return ret; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
_class_instance = register_class_devname(RANGE_FINDER_BASE_DEVICE_PATH); |
|
|
|
|
|
|
|
|
|
/* get a publish handle on the range finder topic */ |
|
|
|
|
struct distance_sensor_s ds_report; |
|
|
|
|
struct distance_sensor_s ds_report = {}; |
|
|
|
|
|
|
|
|
|
_distance_sensor_topic = orb_advertise_multi(ORB_ID(distance_sensor), &ds_report, |
|
|
|
|
&_orb_class_instance, ORB_PRIO_LOW); |
|
|
|
@ -319,7 +319,7 @@ MB12XX::init()
@@ -319,7 +319,7 @@ MB12XX::init()
|
|
|
|
|
ret = OK; |
|
|
|
|
/* sensor is ok, but we don't really know if it is within range */ |
|
|
|
|
_sensor_ok = true; |
|
|
|
|
out: |
|
|
|
|
|
|
|
|
|
return ret; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|