Skip to content

Commit ebee935

Browse files
committed
Remove timeout from in I2C read function. See issue 3.
1 parent 27f1a8a commit ebee935

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=SparkFun MLX90614
2-
version=1.0.1
2+
version=1.0.2
33
author=SparkFun Electronics <[email protected]>
44
maintainer=SparkFun Electronics <sparkfun.com>
55
sentence=Library for the SparkFun IR Thermometer Evaluation Board and the MLX90614 IR thermometer.

src/SparkFunMLX90614.cpp

-7
Original file line numberDiff line numberDiff line change
@@ -355,19 +355,12 @@ float IRTherm::calcTemperature(int16_t rawTemp)
355355

356356
uint8_t IRTherm::I2CReadWord(byte reg, int16_t * dest)
357357
{
358-
int timeout = I2C_READ_TIMEOUT;
359-
360358
Wire.beginTransmission(_deviceAddress);
361359
Wire.write(reg);
362360

363361
Wire.endTransmission(false); // Send restart
364362
Wire.requestFrom(_deviceAddress, (uint8_t) 3);
365363

366-
while ((Wire.available() < 3) && (timeout-- > 0))
367-
delay(1);
368-
if (timeout <= 0)
369-
return 0;
370-
371364
uint8_t lsb = Wire.read();
372365
uint8_t msb = Wire.read();
373366
uint8_t pec = Wire.read();

0 commit comments

Comments
 (0)