fix: using eeprom.update() instead of eeprom.write() ; saves potentia…#68
Closed
labamichnetvoll wants to merge 1 commit intotechniccontroller:mainfrom
Closed
fix: using eeprom.update() instead of eeprom.write() ; saves potentia…#68labamichnetvoll wants to merge 1 commit intotechniccontroller:mainfrom
labamichnetvoll wants to merge 1 commit intotechniccontroller:mainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request improves EEPROM usage by replacing EEPROM.write() calls with EEPROM.update() to extend the EEPROM's lifespan by only writing when values actually change.
- Replaces all
EEPROM.write()calls withEEPROM.update()throughout the codebase - Preserves existing functionality while reducing unnecessary write cycles
- Applies the optimization to configuration settings, state management, and user preference storage
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| EEPROM.update(ADR_NM_END_H, DEFAULT_NM_END_HOUR); | ||
| EEPROM.update(ADR_NM_END_M, DEFAULT_NM_END_MIN); | ||
| EEPROM.update(ADR_BRIGHTNESS, DEFAULT_BRIGHTNESS); | ||
| setMainColor(DEFAULT_MC_RED, DEFAULT_MC_GREEN, DEFAULT_MC_BLUE); |
There was a problem hiding this comment.
The setMainColor function still uses EEPROM.put() instead of EEPROM.update(). For consistency with this PR's goal of optimizing EEPROM writes, consider updating setMainColor to use EEPROM.update() as well.
Author
|
The PR actually looks unnecessary, since the library used already contains a built-in check. Sorry for the ping |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request is using EEPROM.update() instead of EEPROM.write()
This change can save writing cycles to the EEPROM.
this is better because of:
EEPROM Library -> update