Skip to content

Commit 4851c33

Browse files
authored
Merge pull request #139 from nomis/fix-millis-use
Fix millis use
2 parents 21a0046 + 3a21184 commit 4851c33

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

DallasTemperature.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -429,11 +429,11 @@ bool DallasTemperature::requestTemperaturesByAddress(
429429
// Continue to check if the IC has responded with a temperature
430430
void DallasTemperature::blockTillConversionComplete(uint8_t bitResolution) {
431431

432-
int delms = millisToWaitForConversion(bitResolution);
432+
unsigned long delms = millisToWaitForConversion(bitResolution);
433433
if (checkForConversion && !parasite) {
434-
unsigned long now = millis();
435-
while (!isConversionComplete() && (millis() - delms < now))
436-
;
434+
unsigned long start = millis();
435+
while (!isConversionComplete() && (millis() - start < delms))
436+
yield();
437437
} else {
438438
activateExternalPullup();
439439
delay(delms);

0 commit comments

Comments
 (0)