pololu/vl53l0x-arduino

checkTimeoutExpired() comparison does integer promotion incorrectly

kevin-pololu opened this issue · 0 comments

We noticed an integer promotion bug in the checkTimeoutExpired() macro (the subtraction result should be cast to uint16_t, not millis()); should fix and make a new release. This should work:
((io_timeout > 0) && ((uint16_t)(millis() - timeout_start_ms) > io_timeout))