-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Add EEPROMClass and examples #1034
Conversation
@fedy0 Could an |
@eman6576 // Optimise _dirty. Only flagged if data written is different. When 'begin' method is called, it loads into the RAM (_data) the EEPROM memory block whose size is specified by its argument (max_size 4kB ~ 0x1000 or 4096) Also when the 'commit' method is called, it performs the actual write to EEPROM memory if there is a change (ie. _dirty == true) in the buffered _data array in the RAM; thus reducing write cycles. Introducing an explicit update or even within the commit method would impact the time of executing a commit. This implementation would only be justified if commit method is used sparingly. I'd work on that and I hope it maybe helpful. For now, to prolong the lifespan of the flash sector apportioned to the EEPROM, one calls commit() within the program only when necessary Note: Without a call to commit and esp32 looses power supply, all data buffered in RAM(_data) is lost. So for an application that depends on one (battery) or two supplies (regular PSU & battery), any sense in power outage, a commit should be performed or before deep-sleep a commit should be performed too. |
nice! |
Hi, |
In the example 'eeprom_class.ino' read the introduction comments on how to use it. Typically, you have to Also see it's ReadMe If you don't have a 'tools' folder in your '.../Documents/Arduino/' directory, create one first then install the tool inside that folder. Restart your Arduino IDE and navigate to 'Tools' menu to access the 'esp32 partition manager'. @Vorrias thanks for the compliments and sorry for the late reply |
* enchanced EEPROMClass * Added eeprom examles and modified partition * added eeprom class and extra examples * No changes * No changes * added eeprom class and examples * fixed typo * length() returns user-defined sector size * updated and annotated example
[1] Use multiple sector flash partitions defined by the name column in the partition table
[2] Added 'eeprom_class' example to show how to use the 'EEPROMClass'
[3] Included additional methods to the EEPROM library (similar to that of esp32 preference library)
[4] Added 'eeprom_extra' example to show how to use the additional methods
[5] Included in eeprom_class example how to use ESP32 Partition Manager https://github.com/francis94c/ESP32Partitions
Thanks for the opportunity to contribute in this wonderful repo :)