|
|
@ -213,7 +213,8 @@ VL53LXX::VL53LXX(uint8_t rotation, int bus, int address) : |
|
|
|
_orb_class_instance(-1), |
|
|
|
_orb_class_instance(-1), |
|
|
|
_distance_sensor_topic(nullptr), |
|
|
|
_distance_sensor_topic(nullptr), |
|
|
|
_sample_perf(perf_alloc(PC_ELAPSED, "vl53lxx_read")), |
|
|
|
_sample_perf(perf_alloc(PC_ELAPSED, "vl53lxx_read")), |
|
|
|
_comms_errors(perf_alloc(PC_COUNT, "vl53lxx_com_err")) |
|
|
|
_comms_errors(perf_alloc(PC_COUNT, "vl53lxx_com_err")), |
|
|
|
|
|
|
|
_stop_variable(0) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// up the retries since the device misses the first measure attempts
|
|
|
|
// up the retries since the device misses the first measure attempts
|
|
|
|
I2C::_retries = 3; |
|
|
|
I2C::_retries = 3; |
|
|
@ -989,7 +990,7 @@ void info(); |
|
|
|
void |
|
|
|
void |
|
|
|
start(uint8_t rotation) |
|
|
|
start(uint8_t rotation) |
|
|
|
{ |
|
|
|
{ |
|
|
|
int fd; |
|
|
|
int fd = -1; |
|
|
|
|
|
|
|
|
|
|
|
if (g_dev != nullptr) { |
|
|
|
if (g_dev != nullptr) { |
|
|
|
errx(1, "already started"); |
|
|
|
errx(1, "already started"); |
|
|
@ -1022,6 +1023,10 @@ start(uint8_t rotation) |
|
|
|
|
|
|
|
|
|
|
|
fail: |
|
|
|
fail: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fd >= 0) { |
|
|
|
|
|
|
|
close(fd); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (g_dev != nullptr) { |
|
|
|
if (g_dev != nullptr) { |
|
|
|
delete g_dev; |
|
|
|
delete g_dev; |
|
|
|
g_dev = nullptr; |
|
|
|
g_dev = nullptr; |
|
|
@ -1073,6 +1078,8 @@ test() |
|
|
|
|
|
|
|
|
|
|
|
print_message(report); |
|
|
|
print_message(report); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
close(fd); |
|
|
|
|
|
|
|
|
|
|
|
errx(0, "PASS"); |
|
|
|
errx(0, "PASS"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|