In the recent update to fix uint32 millis rollover, I backwardsed math.
When your loop is slow, the calculation reaches 0, then counts up
forever. When your loop is fast, it lies and says the result is ready
immediately (causing blocking, but no other ill effect).
This change subtracts elapsed time from measure period - as is
intuitively necessary.
The beginReading, poll remainingReadMillis, endReading strategy now
blocks a Particle Photon for 0.25ms on average when checking
remainingReadMillis correctly.
In the recent update to fix uint32 millis rollover, I backwardsed math. When your loop is slow, the calculation reaches 0, then counts up forever. When your loop is fast, it lies and says the result is ready immediately (causing blocking, but no other ill effect).
This change subtracts elapsed time from measure period - as is intuitively necessary.
The beginReading, poll remainingReadMillis, endReading strategy now blocks a Particle Photon for 0.25ms on average when checking remainingReadMillis correctly.