diff --git a/src/drivers/distance_sensor/ll40ls/LidarLite.h b/src/drivers/distance_sensor/ll40ls/LidarLite.h index 2ecfc00fab..e86709e01f 100644 --- a/src/drivers/distance_sensor/ll40ls/LidarLite.h +++ b/src/drivers/distance_sensor/ll40ls/LidarLite.h @@ -46,17 +46,16 @@ using namespace time_literals; -/* Device limits */ -#define LL40LS_MIN_DISTANCE (0.05f) -#define LL40LS_MAX_DISTANCE (25.00f) -#define LL40LS_MAX_DISTANCE_V2 (35.00f) - +// Device limits +static constexpr float LL40LS_MIN_DISTANCE{0.05f}; +static constexpr float LL40LS_MAX_DISTANCE{25.00f}; +static constexpr float LL40LS_MAX_DISTANCE_V2{35.00f}; // Normal conversion wait time. -#define LL40LS_CONVERSION_INTERVAL 50_ms +static constexpr uint32_t LL40LS_CONVERSION_INTERVAL{50_ms}; // Maximum time to wait for a conversion to complete. -#define LL40LS_CONVERSION_TIMEOUT 100_ms +static constexpr uint32_t LL40LS_CONVERSION_TIMEOUT{100_ms}; class LidarLite { diff --git a/src/drivers/distance_sensor/ll40ls/LidarLiteI2C.h b/src/drivers/distance_sensor/ll40ls/LidarLiteI2C.h index d4dfef014e..fd011a0887 100644 --- a/src/drivers/distance_sensor/ll40ls/LidarLiteI2C.h +++ b/src/drivers/distance_sensor/ll40ls/LidarLiteI2C.h @@ -73,9 +73,9 @@ static constexpr uint8_t LL40LS_SIG_COUNT_VAL_MAX = 0xFF; /* Maximum acquisi static constexpr int LL40LS_SIGNAL_STRENGTH_MIN_V3HP = 70; /* Min signal strength for V3HP */ static constexpr int LL40LS_SIGNAL_STRENGTH_MAX_V3HP = 255; /* Max signal strength for V3HP */ -static constexpr int LL40LS_SIGNAL_STRENGTH_LOW = 24; /* Minimum relative signal strength for a valid measurement */ -static constexpr int LL40LS_PEAK_STRENGTH_LOW = 135; /* Minimum peak strength raw value for accepting a measurement */ -static constexpr int LL40LS_PEAK_STRENGTH_HIGH = 234; /* Max peak strength raw value */ +static constexpr int LL40LS_SIGNAL_STRENGTH_LOW = 24; /* Minimum signal strength for a valid measurement */ +static constexpr int LL40LS_PEAK_STRENGTH_LOW = 135; /* Minimum peak strength for accepting a measurement */ +static constexpr int LL40LS_PEAK_STRENGTH_HIGH = 234; /* Max peak strength raw value */ class LidarLiteI2C : public LidarLite, public device::I2C, public px4::ScheduledWorkItem diff --git a/src/drivers/distance_sensor/ll40ls/ll40ls.cpp b/src/drivers/distance_sensor/ll40ls/ll40ls.cpp index 98f36704df..743f16bd5d 100644 --- a/src/drivers/distance_sensor/ll40ls/ll40ls.cpp +++ b/src/drivers/distance_sensor/ll40ls/ll40ls.cpp @@ -231,7 +231,7 @@ I2C bus driver for LidarLite rangefinders. The sensor/driver must be enabled using the parameter SENS_EN_LL40LS. -Setup/usage information: https://docs.px4.io/v1.9.0/en/sensor/lidar_lite.htmls +Setup/usage information: https://docs.px4.io/en/sensor/lidar_lite.html ### Examples