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 check for ERR_EEPROM_NOPROM #27255

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

ellensp
Copy link
Contributor

@ellensp ellensp commented Jul 9, 2024

Description

Recent changes to settings.cpp in #27199 resulted in eeproms not being initialized, some ending up setting 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

@thisiskeithb thisiskeithb added this to the Version 2.1.3 milestone Jul 9, 2024
@thisiskeithb thisiskeithb linked an issue Jul 9, 2024 that may be closed by this pull request
1 task
@thisiskeithb
Copy link
Member

resulted in eeproms not being initialized, some ending up setting 0 for all settings

...and causing thermal runaway:

@thinkyhead thinkyhead merged commit 17a1363 into MarlinFirmware:bugfix-2.1.x Jul 10, 2024
62 checks passed
@ellensp ellensp deleted the fix-settings.cpp branch July 10, 2024 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] M501 logic with version mismatch
3 participants