pololu / vl53l0x-arduino

Pololu Arduino library for VL53L0X time-of-flight distance sensor
https://www.pololu.com/product/2490
Other
345 stars 163 forks source link

checkTimeoutExpired() comparison does integer promotion incorrectly #22

Closed kevin-pololu closed 4 years ago

kevin-pololu commented 6 years ago

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))