Skip to content

Commit 3e106ed

Browse files
committed
rename writeEEPROM with writeMLXEEPROM
It appears linker for ESP8266 is replacing this with system's EEPROM write. ESP Exception Decoder has been listing EEPROM functions on my system. I don't know how to investigate in detail but it appears renaming these functions increased stability of my application.
1 parent 07432aa commit 3e106ed

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Diff for: src/SparkFunMLX90614.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -173,15 +173,15 @@ uint8_t IRTherm::setMax(float maxTemp)
173173
// Convert the unit-ed value to a raw ADC value:
174174
int16_t rawMax = calcRawTemp(maxTemp);
175175
// Write that value to the TOMAX EEPROM address:
176-
return writeEEPROM(MLX90614_REGISTER_TOMAX, rawMax);
176+
return writeMLXEEPROM(MLX90614_REGISTER_TOMAX, rawMax);
177177
}
178178

179179
uint8_t IRTherm::setMin(float minTemp)
180180
{
181181
// Convert the unit-ed value to a raw ADC value:
182182
int16_t rawMin = calcRawTemp(minTemp);
183183
// Write that value to the TOMIN EEPROM address:
184-
return writeEEPROM(MLX90614_REGISTER_TOMIN, rawMin);
184+
return writeMLXEEPROM(MLX90614_REGISTER_TOMIN, rawMin);
185185
}
186186

187187
uint8_t IRTherm::setEmissivity(float emis)
@@ -194,7 +194,7 @@ uint8_t IRTherm::setEmissivity(float emis)
194194
ke = constrain(ke, 0x2000, 0xFFFF);
195195

196196
// Write that value to the ke register
197-
return writeEEPROM(MLX90614_REGISTER_KE, (int16_t)ke);
197+
return writeMLXEEPROM(MLX90614_REGISTER_KE, (int16_t)ke);
198198
}
199199

200200
float IRTherm::readEmissivity()
@@ -234,7 +234,7 @@ bool IRTherm::setAddress(uint8_t newAdd)
234234
tempAdd |= newAdd; // Add the new address
235235

236236
// Write the new addres back to EEPROM:
237-
return writeEEPROM(MLX90614_REGISTER_ADDRESS, tempAdd);
237+
return writeMLXEEPROM(MLX90614_REGISTER_ADDRESS, tempAdd);
238238
}
239239
return 0;
240240
}
@@ -388,7 +388,7 @@ bool IRTherm::I2CReadWord(uint8_t reg, int16_t * dest)
388388
}
389389
}
390390

391-
bool IRTherm::writeEEPROM(uint8_t reg, int16_t data)
391+
bool IRTherm::writeMLXEEPROM(uint8_t reg, int16_t data)
392392
{
393393
// Clear out EEPROM first:
394394
if (I2CWriteWord(reg, 0) != 0)

Diff for: src/SparkFunMLX90614.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ class IRTherm
188188

189189
// Abstract function to write 16-bits to an address in the MLX90614's
190190
// EEPROM
191-
bool writeEEPROM(uint8_t reg, int16_t data);
191+
bool writeMLXEEPROM(uint8_t reg, int16_t data);
192192

193193
// Abstract functions to read and write 16-bit values from a RAM
194194
// or EEPROM address in the MLX90614

0 commit comments

Comments
 (0)