Skip to content
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

Option to make bulk write only write changes #37

Closed
merlinz01 opened this issue Jul 10, 2024 · 2 comments
Closed

Option to make bulk write only write changes #37

merlinz01 opened this issue Jul 10, 2024 · 2 comments

Comments

@merlinz01
Copy link
Contributor

Subject of the issue

Currently when you call put() with a struct, the entire struct is written to the memory whether or not anything changed. Could we have a method that checks it byte-by-byte and writes only the changed bytes, in order to preserve the EEPROM lifetime?

Or does the EEPROM do this internally?

Your workbench

  • What development board or microcontroller are you using? N/A
  • What version of hardware or breakout board are you using? 24C02
  • How is the breakout board wired to your microcontroller? I2C
  • How is everything being powered? N/A
  • Are there any additional details that may help us help you? N/A

Steps to reproduce

Call eeprom.put(MyStruct).

Expected behavior

There should be a method or parameter that does the same thing but checks for changes so that we don't put unnecessary wear on the EEPROM.

Actual behavior

The entire struct is written whether or not it changed.

@merlinz01
Copy link
Contributor Author

I have opened a PR with an implementation.

@nseidle
Copy link
Member

nseidle commented Jul 12, 2024

This is wonderful! Thank you for your contribution.

@nseidle nseidle closed this as completed Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants