mirror of
https://github.com/RobTillaart/I2C_EEPROM.git
synced 2026-07-27 20:06:07 +00:00
minor edits
This commit is contained in:
+4
-3
@@ -6,11 +6,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
|
||||
## [1.9.5] - 2025-11-19
|
||||
## [1.9.5] - 2026-01-20
|
||||
- fix #86, add partition() command
|
||||
- update documentation
|
||||
- update GitHub actions
|
||||
- add examples
|
||||
- improve build efficiency (only one example with 5 boards)
|
||||
- add examples eeprom_compare.ino and eeprom_copy.ino
|
||||
- improve build-CI efficiency (only one example with 5 boards)
|
||||
- minor edits
|
||||
|
||||
## [1.9.4] - 2025-08-27
|
||||
|
||||
+16
-11
@@ -83,11 +83,18 @@ uint8_t I2C_eeprom::getAddress()
|
||||
|
||||
uint16_t I2C_eeprom::partition(uint16_t offset, uint16_t size)
|
||||
{
|
||||
// issue #86
|
||||
// TODO verify within range
|
||||
// else error
|
||||
// #86
|
||||
// verify partition is within EEPROM
|
||||
uint32_t tmp = offset;
|
||||
tmp += size;
|
||||
if (tmp >= deviceSize)
|
||||
{
|
||||
return 0; // ?
|
||||
}
|
||||
// remember
|
||||
_partitionOffset = offset;
|
||||
_partitionSize = size;
|
||||
// return endAddress ==> next partition address.
|
||||
return offset + size;
|
||||
}
|
||||
|
||||
@@ -618,9 +625,11 @@ void I2C_eeprom::_beginTransmission(const uint16_t memoryAddress)
|
||||
int I2C_eeprom::_WriteBlock(const uint16_t memoryAddress, const uint8_t * buffer, const uint16_t length)
|
||||
{
|
||||
// #86 - check range
|
||||
// if (_partitionSize && ((memoryAddress + length) > _partitionSize))
|
||||
// uint32_t tmp = memoryAddress;
|
||||
// tmp += length;
|
||||
// if (tmp > _partitionSize)
|
||||
// {
|
||||
// return ERROR
|
||||
// return -999;
|
||||
// }
|
||||
_waitEEReady();
|
||||
if (_autoWriteProtect)
|
||||
@@ -744,7 +753,7 @@ bool I2C_eeprom::_verifyBlock(const uint16_t memoryAddress, const uint8_t * buff
|
||||
uint8_t address = _deviceAddress | (((memoryAddress + _partitionOffset)>> 8) & 0x07);
|
||||
readBytes = _wire->requestFrom((int)address, (int)length);
|
||||
}
|
||||
yield(); // For OS scheduling
|
||||
yield(); // For OS scheduling
|
||||
uint8_t count = 0;
|
||||
while (count < readBytes)
|
||||
{
|
||||
@@ -766,11 +775,7 @@ void I2C_eeprom::_waitEEReady()
|
||||
while ((micros() - _lastWrite) <= waitTime)
|
||||
{
|
||||
if (isConnected()) return;
|
||||
// TODO remove pre 1.7.4 code
|
||||
// _wire->beginTransmission(_deviceAddress);
|
||||
// int x = _wire->endTransmission();
|
||||
// if (x == 0) return;
|
||||
yield(); // For OS scheduling
|
||||
yield(); // For OS scheduling
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -164,6 +164,7 @@ private:
|
||||
uint8_t _pageSize = 0;
|
||||
uint8_t _extraTWR = 0; // milliseconds
|
||||
|
||||
// #86
|
||||
uint16_t _partitionOffset = 0;
|
||||
uint16_t _partitionSize = 0;
|
||||
|
||||
|
||||
@@ -60,6 +60,7 @@ The user has to call **Wire.begin()** and can optionally set the Wire pins
|
||||
- https://github.com/RobTillaart/I2C_24LC1025
|
||||
- https://github.com/RobTillaart/I2C_CAT24M01
|
||||
- https://github.com/RobTillaart/I2C_EEPROM
|
||||
- https://github.com/RobTillaart/I2C_FRAM_I2C - alternative for EEPROM
|
||||
|
||||
|
||||
## Schematic
|
||||
@@ -338,7 +339,7 @@ The library does not offer multiple EEPROMS as one continuous storage device.
|
||||
#### Wont
|
||||
|
||||
- investigate the print interface?
|
||||
- circular buffer? (see FRAM library)
|
||||
- circular buffer? (see FRAM library) - wear and tear risk?
|
||||
- dump function?
|
||||
|
||||
|
||||
|
||||
@@ -91,5 +91,5 @@ void loop()
|
||||
}
|
||||
|
||||
|
||||
// -- END OF FILE
|
||||
// -- END OF FILE --
|
||||
|
||||
|
||||
Reference in New Issue
Block a user