From e9397eeb7500404958ffaa2065715754f880b1c4 Mon Sep 17 00:00:00 2001 From: dvornikov-aa <36663802+dvornikov-aa@users.noreply.github.com> Date: Wed, 31 Jul 2019 20:00:30 +0300 Subject: [PATCH] ll40ls: fix LIDAR-Lite v3 initialization (#12453) --- src/drivers/distance_sensor/ll40ls/LidarLiteI2C.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/drivers/distance_sensor/ll40ls/LidarLiteI2C.cpp b/src/drivers/distance_sensor/ll40ls/LidarLiteI2C.cpp index d4932de393..e2be970895 100644 --- a/src/drivers/distance_sensor/ll40ls/LidarLiteI2C.cpp +++ b/src/drivers/distance_sensor/ll40ls/LidarLiteI2C.cpp @@ -189,8 +189,8 @@ int LidarLiteI2C::probe() check for unit id. It would be better if we had a proper WHOAMI register */ - if (read_reg(LL40LS_UNIT_ID_HIGH, id_high) == OK && id_high > 0 && - read_reg(LL40LS_UNIT_ID_LOW, id_low) == OK && id_low > 0) { + if (read_reg(LL40LS_UNIT_ID_HIGH, id_high) == OK && + read_reg(LL40LS_UNIT_ID_LOW, id_low) == OK) { _unit_id = (uint16_t)((id_high << 8) | id_low) & 0xFFFF; goto ok; }