mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
ll40ls cleanup unnecessary Device CDev usage
This commit is contained in:
parent
585d3bbe55
commit
bdba733dd4
@ -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
|
||||
|
||||
@ -50,7 +50,7 @@
|
||||
#include <drivers/drv_pwm_input.h>
|
||||
|
||||
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;
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user