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

Polishing the EEPROM handling #176

Merged
merged 2 commits into from
Feb 13, 2024
Merged

Conversation

Cabooman
Copy link
Collaborator

@Cabooman Cabooman commented Feb 12, 2024

WHAT

Improved EEPROM handling, event log handling in memory and minimizing the number of writes to the flash-emulated EEPROM

WHY

To clear and re-initialize the event log if it seems incompatible/weird and to reduce the number of writes to EEPROM

HOW

Reducing writes: A counter counts the number of events that are logged. A timer keeps an XX minute timeout. Logged events are only written if the defined time has passed AND we have logged any events.
Log init: Check for a magic number, clear the log if the number differs from what you expect. Could be an older version, junk, etc.

TESTING

Tested on the dining room table, currently live in my setup. Appears to work as intended, i.e. only write to the log if there are events to write.

Serial print at startup (i.e. showing the event log):
image

View of events set since startup in web UI (NOT fetched from the event log, those are currently only visible in the message at boot):
image

@Cabooman Cabooman marked this pull request as ready for review February 12, 2024 20:57
Copy link
Owner

@dalathegreat dalathegreat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Cabooman Cabooman added the enhancement New feature or request label Feb 13, 2024
@Cabooman Cabooman merged commit 9d803c1 into main Feb 13, 2024
36 checks passed
@dalathegreat dalathegreat deleted the improvement/eeprom-event-handling branch February 21, 2024 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants