Browse Source

Make EEPROM storage consistent

Update ConfigurationStore to always write dummy values for disabled
options, including FWRETRACT, DELTA, and SCARA. Update the EEPROM
version to “V15.” Also fixes a buffer overrun with axis_scaling in
Config_ResetDefault.
Scott Lahteine 10 years ago
parent
commit
093fedfde8
3 changed files with 593 additions and 478 deletions
  1. 584
    469
      Marlin/ConfigurationStore.cpp
  2. 7
    7
      Marlin/ConfigurationStore.h
  3. 2
    2
      Marlin/Marlin_main.cpp

+ 584
- 469
Marlin/ConfigurationStore.cpp
File diff suppressed because it is too large
View File


+ 7
- 7
Marlin/ConfigurationStore.h View File

6
 void Config_ResetDefault();
6
 void Config_ResetDefault();
7
 
7
 
8
 #ifndef DISABLE_M503
8
 #ifndef DISABLE_M503
9
-void Config_PrintSettings();
9
+  void Config_PrintSettings(bool forReplay=false);
10
 #else
10
 #else
11
-FORCE_INLINE void Config_PrintSettings() {}
11
+  FORCE_INLINE void Config_PrintSettings(bool forReplay=false) {}
12
 #endif
12
 #endif
13
 
13
 
14
 #ifdef EEPROM_SETTINGS
14
 #ifdef EEPROM_SETTINGS
15
-void Config_StoreSettings();
16
-void Config_RetrieveSettings();
15
+  void Config_StoreSettings();
16
+  void Config_RetrieveSettings();
17
 #else
17
 #else
18
-FORCE_INLINE void Config_StoreSettings() {}
19
-FORCE_INLINE void Config_RetrieveSettings() { Config_ResetDefault(); Config_PrintSettings(); }
18
+  FORCE_INLINE void Config_StoreSettings() {}
19
+  FORCE_INLINE void Config_RetrieveSettings() { Config_ResetDefault(); Config_PrintSettings(); }
20
 #endif
20
 #endif
21
 
21
 
22
-#endif//CONFIG_STORE_H
22
+#endif // __CONFIG_STORE_H

+ 2
- 2
Marlin/Marlin_main.cpp View File

164
 // M500 - stores parameters in EEPROM
164
 // M500 - stores parameters in EEPROM
165
 // M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
165
 // M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
166
 // M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
166
 // M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
167
-// M503 - print the current settings (from memory not from EEPROM)
167
+// M503 - print the current settings (from memory not from EEPROM). Use S0 to leave off headings.
168
 // M540 - Use S[0|1] to enable or disable the stop SD card print on endstop hit (requires ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
168
 // M540 - Use S[0|1] to enable or disable the stop SD card print on endstop hit (requires ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
169
 // M600 - Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal]
169
 // M600 - Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal]
170
 // M665 - set delta configurations
170
 // M665 - set delta configurations
3581
     break;
3581
     break;
3582
     case 503: // M503 print settings currently in memory
3582
     case 503: // M503 print settings currently in memory
3583
     {
3583
     {
3584
-        Config_PrintSettings();
3584
+        Config_PrintSettings(code_seen('S') && code_value == 0);
3585
     }
3585
     }
3586
     break;
3586
     break;
3587
     #ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
3587
     #ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED

Loading…
Cancel
Save