Browse Source

ll40ls: fixed typo errors.

Signed-off-by: Claudio Micheli <claudio@auterion.com>
sbg
Claudio Micheli 6 years ago committed by Nuno Marques
parent
commit
5fd483dbf8
  1. 24
      src/drivers/distance_sensor/ll40ls/LidarLiteI2C.cpp
  2. 4
      src/drivers/distance_sensor/ll40ls/LidarLiteI2C.h

24
src/drivers/distance_sensor/ll40ls/LidarLiteI2C.cpp

@ -128,17 +128,17 @@ LidarLiteI2C::probe()
set_device_address(addresses[i]); set_device_address(addresses[i]);
/* /**
The probing is divided in two cases. One to detect v1, v2 and v3 and one to * The probing is divided into different cases. One to detect v2, one for v3 and v1 and one for v3HP.
detect v3HP. The reason for this is that registers are not consistent * The reason for this is that registers are not consistent between different versions.
between different versions. The v3HP doesn't have the HW VERSION (or at least no version is specified) * The v3HP doesn't have the HW VERSION (or at least no version is specified),
while v1, v2 and some v3 don't have the unit id register. * v1 and v3 don't have the unit id register while v2 has both.
It would be better if we had a proper WHOAMI register. * It would be better if we had a proper WHOAMI register.
*/ */
/* /**
check for hw and sw versions for v1, v2 and v3 * check for hw and sw versions for v1, v2 and v3
*/ */
if ((read_reg(LL40LS_HW_VERSION, _hw_version) == OK) && if ((read_reg(LL40LS_HW_VERSION, _hw_version) == OK) &&
(read_reg(LL40LS_SW_VERSION, _sw_version) == OK)) { (read_reg(LL40LS_SW_VERSION, _sw_version) == OK)) {
@ -397,8 +397,8 @@ int LidarLiteI2C::collect()
// We detect if V3HP is being used // We detect if V3HP is being used
if (_is_V3hp) { if (_is_V3hp) {
signal_min = LL40LS_SIGNAL_STRENGH_MIN_V3HP; signal_min = LL40LS_SIGNAL_STRENGTH_MIN_V3HP;
signal_max = LL40LS_SIGNAL_STRENGH_MAX_V3HP; signal_max = LL40LS_SIGNAL_STRENGTH_MAX_V3HP;
signal_value = ll40ls_signal_strength; signal_value = ll40ls_signal_strength;
} else { } else {
@ -414,7 +414,7 @@ int LidarLiteI2C::collect()
read before it is ready, so only consider it read before it is ready, so only consider it
an error if more than 100ms has elapsed. an error if more than 100ms has elapsed.
*/ */
PX4_INFO("peak strenght read failed"); PX4_INFO("peak strength read failed");
DEVICE_DEBUG("error reading peak strength from sensor: %d", ret); DEVICE_DEBUG("error reading peak strength from sensor: %d", ret);
perf_count(_comms_errors); perf_count(_comms_errors);

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

@ -67,8 +67,8 @@ static constexpr uint8_t LL40LS_UNIT_ID_LOW = 0x17;
static constexpr uint8_t LL40LS_SIG_COUNT_VAL_REG = 0x02; /* Maximum acquisition count register */ static constexpr uint8_t LL40LS_SIG_COUNT_VAL_REG = 0x02; /* Maximum acquisition count register */
static constexpr uint8_t LL40LS_SIG_COUNT_VAL_MAX = 0xFF; /* Maximum acquisition count max value */ static constexpr uint8_t LL40LS_SIG_COUNT_VAL_MAX = 0xFF; /* Maximum acquisition count max value */
static constexpr int LL40LS_SIGNAL_STRENGH_MIN_V3HP = 70; // Min signal strength for V3HP static constexpr int LL40LS_SIGNAL_STRENGTH_MIN_V3HP = 70; // Min signal strength for V3HP
static constexpr int LL40LS_SIGNAL_STRENGH_MAX_V3HP = 255; // Max 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 = static constexpr int LL40LS_SIGNAL_STRENGTH_LOW =
24; // Minimum (relative) signal strength value for accepting a measurement 24; // Minimum (relative) signal strength value for accepting a measurement

Loading…
Cancel
Save