Skip to content
Commit 60b149c2 authored by Keith Packard's avatar Keith Packard Committed by Erwan Gouriou
Browse files

vl53l0x: Cast unsigned abs param to signed type to fix clang warning



FixPoint1616_t is typedef'd to uint32_t. The result of dividing two
variables of that type is also unsigned. Passing an unsigned value to
abs doesn't make sense.

Cast the value to int32_t in case the computaton of diff1_mcps
generates a negative result so that xTalkCorrection doesn't end up
with a huge value.

Signed-off-by: default avatarKeith Packard <keithp@keithp.com>
parent cccbc24c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment