You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
millis() - delms is unsigned (because now is unsigned and both sides of the < are promoted). At a rollover interval, this can exit too soon. The correct calculation is:
(millis() - now) < (unsigned) delms
The result of millis() - now is always the right number of elapsed milliseconds, regardless of rollover.
The text was updated successfully, but these errors were encountered:
Timeout calculation has a signed compare problem.
Arduino-Temperature-Control-Library/DallasTemperature.cpp
Lines 372 to 373 in a02a6d3
millis() - delms
is unsigned (becausenow
is unsigned and both sides of the<
are promoted). At a rollover interval, this can exit too soon. The correct calculation is:(millis() - now) < (unsigned) delms
The result of
millis() - now
is always the right number of elapsed milliseconds, regardless of rollover.The text was updated successfully, but these errors were encountered: