Skip to content

Commit c413bb3

Browse files
authored
Merge pull request #4 from crabel99/fix-compiler-warnings
Fix PlatformIO Compiler Warnings
2 parents 8b546dd + e25a1f3 commit c413bb3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/SparkFun_MCP9600.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ bool MCP9600::setThermocoupleResolution(Thermocouple_Resolution res)
190190
Thermocouple_Resolution MCP9600::getThermocoupleResolution()
191191
{
192192
uint8_t config = readSingleRegister(DEVICE_CONFIG); //grab current device configuration
193-
uint8_t res; //define new thermocoupleResolution enum to return
193+
uint8_t res = 0; //define new thermocoupleResolution enum to return
194194
bool highResolutionBit = bitRead(config, 6);
195195
bool lowResolutionBit = bitRead(config, 5);
196196
bitWrite(res, 1, highResolutionBit); //set 1st bit of the enum to the 6th bit of the config register
@@ -270,7 +270,7 @@ Burst_Sample MCP9600::getBurstSamples()
270270
bool highResolutionBit = bitRead(config, 4);
271271
bool midResolutionBit = bitRead(config, 3);
272272
bool lowResolutionBit = bitRead(config, 2);
273-
uint8_t samples;
273+
uint8_t samples = 0;
274274
bitWrite(samples, 2, highResolutionBit); //write 4th bit of config to 2nd bit of samples
275275
bitWrite(samples, 1, midResolutionBit); //write 3rd bit of config to 1st bit of samples
276276
bitWrite(samples, 0, lowResolutionBit); //write 2nd bit of config to 0th bit of samples

0 commit comments

Comments
 (0)