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

Fix settings.cpp #27254

Closed
wants to merge 1 commit into from
Closed

Fix settings.cpp #27254

wants to merge 1 commit into from

Conversation

ellensp
Copy link
Contributor

@ellensp ellensp commented Jul 9, 2024

Description

Resent changes to settings.cpp in #27199 resulted in eeproms being initialized to all 0 for all settings

I believe this is the fix.

diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp
index d4467b7687..a553d56745 100644
--- a/Marlin/src/module/settings.cpp
+++ b/Marlin/src/module/settings.cpp
@@ -1823,7 +1823,7 @@ void MarlinSettings::postprocess() {
     EEPROM_Error eeprom_error = ERR_EEPROM_NOERR;
 
     const EEPROM_Error check = check_version();
-    if (check == ERR_EEPROM_VERSION) return eeprom_error;
+    if (check == ERR_EEPROM_NOPROM) return eeprom_error;
 
     uint16_t stored_crc;

While dbuezas proposed a slight variant

diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp
index d4467b7687..a553d56745 100644
--- a/Marlin/src/module/settings.cpp
+++ b/Marlin/src/module/settings.cpp
@@ -1823,7 +1823,7 @@ void MarlinSettings::postprocess() {
     EEPROM_Error eeprom_error = ERR_EEPROM_NOERR;
 
     const EEPROM_Error check = check_version();
-    if (check == ERR_EEPROM_VERSION) return eeprom_error;
+    if (check == ERR_EEPROM_NOPROM) return ERR_EEPROM_NOERR;
 
     uint16_t stored_crc;

This PR added my version for consideration

Requirements

EEPROM

Benefits

Works as expected

Related Issues

  • [BUG] M501 logic with version mismatch #27236
  • Load settings after showing bootscreen #27199#issuecomment-2217460127
  • @ellensp ellensp closed this Jul 9, 2024
    @ellensp ellensp deleted the ellensp-patch-1 branch July 9, 2024 13:26
    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