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:
Keith Packard <keithp@keithp.com>
Loading
Please sign in to comment