Skip to content

Commit

Permalink
Change #defines to static constexpr types in LidateLite.h, updated th…
Browse files Browse the repository at this point in the history
…e docs link in ll40ls.cpp, and shortened comments to allow uniform indentation in LidarLiteI2C.h.
  • Loading branch information
mcsauder authored and TSC21 committed Sep 27, 2019
1 parent 9023030 commit 4f71c4e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
13 changes: 6 additions & 7 deletions src/drivers/distance_sensor/ll40ls/LidarLite.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
6 changes: 3 additions & 3 deletions src/drivers/distance_sensor/ll40ls/LidarLiteI2C.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/distance_sensor/ll40ls/ll40ls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4f71c4e

Please sign in to comment.