Browse Source

Change #defines to static constexpr types in LidateLite.h, updated the docs link in ll40ls.cpp, and shortened comments to allow uniform indentation in LidarLiteI2C.h.

sbg
mcsauder 5 years ago committed by Nuno Marques
parent
commit
4f71c4e123
  1. 13
      src/drivers/distance_sensor/ll40ls/LidarLite.h
  2. 4
      src/drivers/distance_sensor/ll40ls/LidarLiteI2C.h
  3. 2
      src/drivers/distance_sensor/ll40ls/ll40ls.cpp

13
src/drivers/distance_sensor/ll40ls/LidarLite.h

@ -46,17 +46,16 @@ @@ -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
{

4
src/drivers/distance_sensor/ll40ls/LidarLiteI2C.h

@ -73,8 +73,8 @@ static constexpr uint8_t LL40LS_SIG_COUNT_VAL_MAX = 0xFF; /* Maximum acquisi @@ -73,8 +73,8 @@ 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_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 */

2
src/drivers/distance_sensor/ll40ls/ll40ls.cpp

@ -231,7 +231,7 @@ I2C bus driver for LidarLite rangefinders. @@ -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

Loading…
Cancel
Save