@@ -309,15 +309,6 @@ bool DallasTemperature::getCheckForConversion(){
309309 return checkForConversion;
310310}
311311
312- bool DallasTemperature::isConversionAvailable (const uint8_t * deviceAddress){
313-
314- // Check if the clock has been raised indicating the conversion is complete
315- ScratchPad scratchPad;
316- readScratchPad (deviceAddress, scratchPad);
317- return scratchPad[0 ];
318-
319- }
320-
321312bool DallasTemperature::isConversionComplete ()
322313{
323314 uint8_t b = _wire->read_bit ();
@@ -333,7 +324,7 @@ void DallasTemperature::requestTemperatures(){
333324
334325 // ASYNC mode?
335326 if (!waitForConversion) return ;
336- blockTillConversionComplete (bitResolution, NULL );
327+ blockTillConversionComplete (bitResolution);
337328
338329}
339330
@@ -347,31 +338,27 @@ bool DallasTemperature::requestTemperaturesByAddress(const uint8_t* deviceAddres
347338 return false ; // Device disconnected
348339 }
349340
350- if (_wire->reset () == 0 ){
351- return false ;
352- }
353-
341+ _wire->reset ();
354342 _wire->select (deviceAddress);
355343 _wire->write (STARTCONVO, parasite);
356344
357-
358345 // ASYNC mode?
359346 if (!waitForConversion) return true ;
360347
361- blockTillConversionComplete (bitResolution, deviceAddress );
348+ blockTillConversionComplete (bitResolution);
362349
363350 return true ;
364351
365352}
366353
367354
368355// Continue to check if the IC has responded with a temperature
369- void DallasTemperature::blockTillConversionComplete (uint8_t bitResolution, const uint8_t * deviceAddress ){
356+ void DallasTemperature::blockTillConversionComplete (uint8_t bitResolution){
370357
371358 int delms = millisToWaitForConversion (bitResolution);
372- if (deviceAddress != NULL && checkForConversion && !parasite){
359+ if (checkForConversion && !parasite){
373360 unsigned long now = millis ();
374- while (!isConversionAvailable (deviceAddress ) && (millis () - delms < now));
361+ while (!isConversionComplete ( ) && (millis () - delms < now));
375362 } else {
376363 delay (delms);
377364 }
0 commit comments