Skip to content

Commit

Permalink
LidarLitePWM: refactor static cast and comment
Browse files Browse the repository at this point in the history
  • Loading branch information
MaEtUgR committed Dec 11, 2024
1 parent 6aefad5 commit 7510980
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/drivers/distance_sensor/ll40ls_pwm/LidarLitePWM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ LidarLitePWM::measure()
return PX4_ERROR;
}

const float current_distance = float(_pwm.pulse_width) * 1e-3f; /* 10 usec = 1 cm distance for LIDAR-Lite */
const float current_distance = static_cast<float>(_pwm.pulse_width) * 1e-3f; // 1us = 1mm distance for LIDAR-Lite

/* Due to a bug in older versions of the LidarLite firmware, we have to reset sensor on (distance == 0) */
if (current_distance <= 0.0f) {
Expand Down

0 comments on commit 7510980

Please sign in to comment.