Skip to content

Update SparkFun_External_EEPROM.cpp #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/SparkFun_External_EEPROM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ void ExternalEEPROM::read(uint32_t eepromLocation, uint8_t *buff, uint16_t buffe
}

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

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

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

settings.i2cPort->beginTransmission(i2cAddress);
Expand Down
5 changes: 5 additions & 0 deletions src/SparkFun_External_EEPROM.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@
#define I2C_BUFFER_LENGTH_RX BUFFER_LENGTH //Teensy
#define I2C_BUFFER_LENGTH_TX BUFFER_LENGTH

#elif defined(ESP32)

#define I2C_BUFFER_LENGTH_RX I2C_BUFFER_LENGTH
#define I2C_BUFFER_LENGTH_TX I2C_BUFFER_LENGTH

#else

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