Skip to content

Commit 019c18e

Browse files
author
Nathan Seidle
committed
2 parents 106c3b4 + 7b8e1c7 commit 019c18e

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/SparkFun_External_EEPROM.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ void ExternalEEPROM::read(uint32_t eepromLocation, uint8_t *buff, uint16_t buffe
157157
}
158158

159159
//See if EEPROM is available or still writing a previous request
160-
while (isBusy(i2cAddress) == true) //Poll device
160+
while (settings.pollForWriteComplete && isBusy(i2cAddress) == true) //Poll device
161161
delayMicroseconds(100); //This shortens the amount of time waiting between writes but hammers the I2C bus
162162

163163
settings.i2cPort->beginTransmission(i2cAddress);
@@ -221,7 +221,7 @@ void ExternalEEPROM::write(uint32_t eepromLocation, const uint8_t *dataToWrite,
221221
}
222222

223223
//See if EEPROM is available or still writing a previous request
224-
while (isBusy(i2cAddress) == true) //Poll device
224+
while (settings.pollForWriteComplete && isBusy(i2cAddress) == true) //Poll device
225225
delayMicroseconds(100); //This shortens the amount of time waiting between writes but hammers the I2C bus
226226

227227
settings.i2cPort->beginTransmission(i2cAddress);

src/SparkFun_External_EEPROM.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@
4949
#define I2C_BUFFER_LENGTH_RX BUFFER_LENGTH //Teensy
5050
#define I2C_BUFFER_LENGTH_TX BUFFER_LENGTH
5151

52+
#elif defined(ESP32)
53+
54+
#define I2C_BUFFER_LENGTH_RX I2C_BUFFER_LENGTH
55+
#define I2C_BUFFER_LENGTH_TX I2C_BUFFER_LENGTH
56+
5257
#else
5358

5459
#pragma GCC error "This platform doesn't have a wire buffer size defined. Please contribute to this library!"

0 commit comments

Comments
 (0)