Skip to content

Conversation

techniccontroller
Copy link
Owner

…es #66

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces an EEPROM versioning system to handle default settings updates for a word clock ESP8266 project. The implementation allows the system to detect when stored settings are outdated and automatically reset them to new defaults.

  • Adds EEPROM version code mechanism to track configuration schema changes
  • Refactors EEPROM address definitions and reduces memory usage from 30 to 13 bytes
  • Centralizes default values as named constants and updates variable initializations

EEPROM.write(ADR_NM_END_H, DEFAULT_NM_END_HOUR);
EEPROM.write(ADR_NM_END_M, DEFAULT_NM_END_MIN);
EEPROM.write(ADR_BRIGHTNESS, DEFAULT_BRIGHTNESS);
setMainColor(DEFAULT_MC_RED, DEFAULT_MC_GREEN, DEFAULT_MC_BLUE);
Copy link

Copilot AI Aug 3, 2025

Choose a reason for hiding this comment

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

The setMainColor function writes to EEPROM addresses ADR_MC_RED, ADR_MC_GREEN, and ADR_MC_BLUE, but these addresses have changed from the original 20, 22, 24 to new values 6, 7, 8. However, the function is being called during EEPROM initialization before these new address values are written individually on lines 249, which creates redundant writes to the same locations.

Suggested change
setMainColor(DEFAULT_MC_RED, DEFAULT_MC_GREEN, DEFAULT_MC_BLUE);

Copilot uses AI. Check for mistakes.


// DEFAULT SETTINGS (if one changes this, also increment the EEPROM_VERSION_CODE, to ensure that the EEPROM is updated with the new defaults)
#define DEFAULT_NM_START_HOUR 22 // default start hour of nightmode (0-23)
#define DEFAULT_NM_START_MIN 5 // default start minute of nightmode (0-59)
Copy link

Copilot AI Aug 3, 2025

Choose a reason for hiding this comment

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

The default start minute is set to 5, but the original initialization on line 216 was 0. This changes the default nightmode start time from 22:00 to 22:05, which may be an unintended behavior change.

Suggested change
#define DEFAULT_NM_START_MIN 5 // default start minute of nightmode (0-59)
#define DEFAULT_NM_START_MIN 0 // default start minute of nightmode (0-59)

Copilot uses AI. Check for mistakes.

@techniccontroller techniccontroller merged commit 737f249 into main Aug 3, 2025
2 checks passed
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

Successfully merging this pull request may close these issues.

1 participant