Skip to content

Commit

Permalink
ll40ls: fix LIDAR-Lite v3 initialization (#12453)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvornikov-aa authored and dagar committed Jul 31, 2019
1 parent 1600b0f commit e9397ee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/drivers/distance_sensor/ll40ls/LidarLiteI2C.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit e9397ee

Please sign in to comment.