From bdba733dd4c12445e6a53fa0d8addde099eb09f4 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Sat, 18 Aug 2018 15:07:28 -0400 Subject: [PATCH] ll40ls cleanup unnecessary Device CDev usage --- .../distance_sensor/ll40ls/LidarLiteI2C.cpp | 16 ++++++++-------- .../distance_sensor/ll40ls/LidarLitePWM.cpp | 6 +++--- .../distance_sensor/ll40ls/LidarLitePWM.h | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/drivers/distance_sensor/ll40ls/LidarLiteI2C.cpp b/src/drivers/distance_sensor/ll40ls/LidarLiteI2C.cpp index 7ad4f1fdcf..995072bf6f 100644 --- a/src/drivers/distance_sensor/ll40ls/LidarLiteI2C.cpp +++ b/src/drivers/distance_sensor/ll40ls/LidarLiteI2C.cpp @@ -125,7 +125,7 @@ int LidarLiteI2C::init() &_orb_class_instance, ORB_PRIO_LOW); if (_distance_sensor_topic == nullptr) { - DEVICE_DEBUG("failed to create distance_sensor object. Did you start uOrb?"); + PX4_DEBUG("failed to create distance_sensor object. Did you start uOrb?"); } ret = OK; @@ -185,9 +185,9 @@ int LidarLiteI2C::probe() goto ok; } - DEVICE_DEBUG("probe failed hw_version=0x%02x sw_version=0x%02x\n", - (unsigned)_hw_version, - (unsigned)_sw_version); + PX4_DEBUG("probe failed hw_version=0x%02x sw_version=0x%02x\n", + (unsigned)_hw_version, + (unsigned)_sw_version); } // not found on any address @@ -309,7 +309,7 @@ int LidarLiteI2C::measure() if (OK != ret) { perf_count(_comms_errors); - DEVICE_DEBUG("i2c::transfer returned %d", ret); + PX4_DEBUG("i2c::transfer returned %d", ret); // if we are getting lots of I2C transfer errors try // resetting the sensor @@ -407,7 +407,7 @@ int LidarLiteI2C::collect() read before it is ready, so only consider it an error if more than 100ms has elapsed. */ - DEVICE_DEBUG("error reading from sensor: %d", ret); + PX4_DEBUG("error reading from sensor: %d", ret); perf_count(_comms_errors); if (perf_event_count(_comms_errors) % 10 == 0) { @@ -581,7 +581,7 @@ void LidarLiteI2C::cycle() /* try a collection */ if (OK != collect()) { - DEVICE_DEBUG("collection error"); + PX4_DEBUG("collection error"); /* if we've been waiting more than 200ms then send a new acquire */ @@ -613,7 +613,7 @@ void LidarLiteI2C::cycle() if (_collect_phase == false) { /* measurement phase */ if (OK != measure()) { - DEVICE_DEBUG("measure error"); + PX4_DEBUG("measure error"); } else { /* next phase is collection. Don't switch to diff --git a/src/drivers/distance_sensor/ll40ls/LidarLitePWM.cpp b/src/drivers/distance_sensor/ll40ls/LidarLitePWM.cpp index f953fe1820..209953fed7 100644 --- a/src/drivers/distance_sensor/ll40ls/LidarLitePWM.cpp +++ b/src/drivers/distance_sensor/ll40ls/LidarLitePWM.cpp @@ -50,7 +50,7 @@ #include LidarLitePWM::LidarLitePWM(const char *path, uint8_t rotation) : - CDev("LidarLitePWM", path), + CDev(path), _rotation(rotation), _work{}, _reports(nullptr), @@ -111,7 +111,7 @@ int LidarLitePWM::init() &_orb_class_instance, ORB_PRIO_LOW); if (_distance_sensor_topic == nullptr) { - DEVICE_DEBUG("failed to create distance_sensor object. Did you start uOrb?"); + PX4_DEBUG("failed to create distance_sensor object. Did you start uOrb?"); } return PX4_OK; @@ -167,7 +167,7 @@ int LidarLitePWM::measure() perf_begin(_sample_perf); if (PX4_OK != collect()) { - DEVICE_DEBUG("collection error"); + PX4_DEBUG("collection error"); perf_count(_read_errors); perf_end(_sample_perf); return PX4_ERROR; diff --git a/src/drivers/distance_sensor/ll40ls/LidarLitePWM.h b/src/drivers/distance_sensor/ll40ls/LidarLitePWM.h index df79d4502c..a2249b818a 100644 --- a/src/drivers/distance_sensor/ll40ls/LidarLitePWM.h +++ b/src/drivers/distance_sensor/ll40ls/LidarLitePWM.h @@ -57,7 +57,7 @@ -class LidarLitePWM : public LidarLite, public device::CDev +class LidarLitePWM : public LidarLite, public cdev::CDev { public: LidarLitePWM(const char *path, uint8_t rotation = distance_sensor_s::ROTATION_DOWNWARD_FACING);