-
Notifications
You must be signed in to change notification settings - Fork 5
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
Only write if byte is different #9
Comments
I do like this idea. It seems like it should save a little bit of wear on the device by not writing unless necessary. Are you interested in submitting a PR with this change perhaps? |
What is a PR? How do I submit one? Do I get and Brownie Points? It will have the biggest impact when erasing an EEPROM. |
@b-blake PR is Pull Request. Essentially it's proposing a change in the library that then can get reviewed by project maintainers and merged in if accepted. There is a guide here: https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github/create-your-pull-request that gives a more in depth description and covers the process. That whole guide contains great information to get you started contributing to CircuitPython libraries. |
@FoamyGuy OK, I have not modified your code to add this feature. I looked and am not sure where in the code a byte is actually written to the EEPROM. So I guess I will have to leave it as an idea the code manager considers for implementation. Thank you for the offer. |
@b-blake It writes to the EEPROM ultimately from here: Adafruit_CircuitPython_24LC32/adafruit_24lc32.py Lines 133 to 154 in f8fc83f
The line near the end does the writing specifically. It could be put inside of an if statement that checks the address / value and then only calls |
FG, I found that line/part. Where is a byte read? BBB |
I think you can read a value using square brackets just like it's done in the examples.
|
Thank you for the tip, however whoever wrote the code is smarter than me. |
Only Write to a byte if it is different. Read the byte and compare before writing the byte.
The text was updated successfully, but these errors were encountered: