-
Notifications
You must be signed in to change notification settings - Fork 39
add configurable EEPROM length #127
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
Conversation
since the flashContent buffer is declared on the stack it may be dynamically sized. the user can take advantage of this to allow for any size EEPROM up to the allocated 1 page of flash. - added 'allowedSize' member to EEPROMClass - added setter for allowedSize 'setLength' - adjusted 'length' to return allowedSize - adjusted 'writeBlockToEEPROM' to use the allowedSize of the EEPROM structure when checking flash memory. - added example usage to Example2_AllFunctions
In response to #126 |
taking suggestions from @rustycoat
@rustycoat thanks for the comments. I've updated the notes in the header file and implemented the ternary consition in
|
Thanks @oclyke. I'm a homesteader living off grid without much technology or time for things like contributing to open source, but I greatly value the open source way of doing things. 20 years ago I was a software developer, but back then it was CVS not git and, even so, I barely remember that process :). Thanks for the instructions, hopefully I'll have some time to do my part the next time I spot a potential bug. |
writing to 8176 and above seems likely to cause a crash with 32 and 64-bit wide data types. restricting the size of EEPROM a little bit seems to nearly eliminate these problems. while this is not a true solution or a good fix it is good enough for now
Looks good and tests good. Thanks for expanding this! |
since the flashContent buffer is declared on the stack it may be dynamically sized the user can take advantage of this to allow for any size EEPROM up to the allocated 1 page of flash
added 'allowedSize' member to EEPROMClass
added setter for allowedSize 'setLength'
adjusted 'length' to return allowedSize
adjusted 'writeBlockToEEPROM' to use the allowedSize of the EEPROM structure when checking flash memory.
added example usage to Example2_AllFunctions