@@ -101,7 +101,7 @@ void DallasTemperature::setOneWire(OneWire* _oneWire) {
101101 devices = 0 ;
102102 ds18Count = 0 ;
103103 parasite = false ;
104- bitResolution = 9 ;
104+ globalBitResolution = 9 ;
105105 waitForConversion = true ;
106106 checkForConversion = true ;
107107 autoSaveScratchPad = true ;
@@ -129,7 +129,7 @@ void DallasTemperature::begin(void) {
129129 parasite = true ;
130130
131131 uint8_t b = getResolution (deviceAddress);
132- if (b > bitResolution) bitResolution = b;
132+ if (b > globalBitResolution) globalBitResolution = b;
133133 }
134134 }
135135 }
@@ -259,12 +259,12 @@ bool DallasTemperature::readPowerSupply(const uint8_t* deviceAddress)
259259// if new resolution is out of range, it is constrained.
260260void DallasTemperature::setResolution (uint8_t newResolution) {
261261
262- bitResolution = constrain (newResolution, 9 , 12 );
262+ globalBitResolution = constrain (newResolution, 9 , 12 );
263263 DeviceAddress deviceAddress;
264264 _wire->reset_search ();
265265 for (uint8_t i = 0 ; i < devices; i++) {
266266 if (_wire->search (deviceAddress) && validAddress (deviceAddress)) {
267- setResolution (deviceAddress, bitResolution , true );
267+ setResolution (deviceAddress, globalBitResolution , true );
268268 }
269269 }
270270}
@@ -325,15 +325,15 @@ bool DallasTemperature::setResolution(const uint8_t* deviceAddress,
325325
326326 // do we need to update the max resolution used?
327327 if (skipGlobalBitResolutionCalculation == false ) {
328- bitResolution = newResolution;
328+ globalBitResolution = newResolution;
329329 if (devices > 1 ) {
330330 DeviceAddress deviceAddr;
331331 _wire->reset_search ();
332332 for (uint8_t i = 0 ; i < devices; i++) {
333- if (bitResolution == 12 ) break ;
333+ if (globalBitResolution == 12 ) break ;
334334 if (_wire->search (deviceAddr) && validAddress (deviceAddr)) {
335335 uint8_t b = getResolution (deviceAddr);
336- if (b > bitResolution) bitResolution = b;
336+ if (b > globalBitResolution) globalBitResolution = b;
337337 }
338338 }
339339 }
@@ -345,7 +345,7 @@ bool DallasTemperature::setResolution(const uint8_t* deviceAddress,
345345
346346// returns the global resolution
347347uint8_t DallasTemperature::getResolution () {
348- return bitResolution ;
348+ return globalBitResolution ;
349349}
350350
351351// returns the current resolution of the device, 9-12
@@ -426,7 +426,7 @@ DallasTemperature::request_t DallasTemperature::requestTemperatures() {
426426 req.timestamp = millis ();
427427 if (!waitForConversion)
428428 return req;
429- blockTillConversionComplete (bitResolution , req.timestamp );
429+ blockTillConversionComplete (globalBitResolution , req.timestamp );
430430 return req;
431431}
432432
@@ -435,8 +435,8 @@ DallasTemperature::request_t DallasTemperature::requestTemperatures() {
435435// returns TRUE otherwise
436436DallasTemperature::request_t DallasTemperature::requestTemperaturesByAddress (const uint8_t * deviceAddress) {
437437 DallasTemperature::request_t req = {};
438- uint8_t bitResolution = getResolution (deviceAddress);
439- if (bitResolution == 0 ) {
438+ uint8_t deviceBitResolution = getResolution (deviceAddress);
439+ if (deviceBitResolution == 0 ) {
440440 req.result = false ;
441441 return req; // Device disconnected
442442 }
@@ -451,7 +451,7 @@ DallasTemperature::request_t DallasTemperature::requestTemperaturesByAddress(con
451451 if (!waitForConversion)
452452 return req;
453453
454- blockTillConversionComplete (bitResolution , req.timestamp );
454+ blockTillConversionComplete (deviceBitResolution , req.timestamp );
455455
456456 return req;
457457
@@ -501,7 +501,7 @@ uint16_t DallasTemperature::millisToWaitForConversion(uint8_t bitResolution) {
501501
502502// returns number of milliseconds to wait till conversion is complete (based on IC datasheet)
503503uint16_t DallasTemperature::millisToWaitForConversion () {
504- return millisToWaitForConversion (bitResolution );
504+ return millisToWaitForConversion (globalBitResolution );
505505}
506506
507507// Sends command to one device to save values from scratchpad to EEPROM by index
0 commit comments