-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
EEPROMClass _dirty #2217
Comments
For read-only of _data, a method that returns a const ptr could be implemented, which doesn't set _dirty. |
@pgScorpio Please test PR #3849 . |
Hi,what does this EEPROM.getDataPtr(); actualy do? What is happening bellow,i want to port a sketch to Arduino uno and the uno eeprom library doesnt support this EEPROM.getDataPtr();. All i know its a pointer but why is it needed.thanks EEPROM.begin(EEPROM_SIZE); |
In our case EEPROM is emulated on flash. To avoid rewriting on every byte, there is a buffer kept in memory, so when you write to an index in the eeprom, you really just write into the buffer. Then when you call commit, the buffer gets written to flash all at once. |
Hardware
Hardware: n.a.
Core Version: 2.2.0
Description
1:
There is no way to undo/revert any changes after a begin.
Currently the only way would be to call begin again, but... See 2:
I suggest adding:
2:
void EEPROMClass::begin(...)
Does read _data from eeprom but does not clear the _dirty flag.Also it would be handy if
EEPROMClass::begin(...)
would return the _data pointer.I suggest:
3:
EEPROMClass::getDataPtr()
Does always set _dirty. This is not wanted if we are using the pointer only for reading....I suggest:
with the default forWrite = true
getDataPtr()
would still be compatible with the current version but when just readinggetDataPtr(false)
would not set _dirty to trueThe text was updated successfully, but these errors were encountered: