Browse Source

Merge pull request #1428 from thinkyhead/issue_1388_eeprom

Make EEPROM storage consistent
Scott Lahteine 9 years ago
parent
commit
7df9ca051c
5 changed files with 608 additions and 481 deletions
  1. 595
    472
      Marlin/ConfigurationStore.cpp
  2. 7
    7
      Marlin/ConfigurationStore.h
  3. 2
    0
      Marlin/Marlin.h
  4. 2
    2
      Marlin/Marlin_main.cpp
  5. 2
    0
      Marlin/language.h

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


+ 7
- 7
Marlin/ConfigurationStore.h View File

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

+ 2
- 0
Marlin/Marlin.h View File

@@ -86,6 +86,8 @@ extern const char echomagic[] PROGMEM;
86 86
 
87 87
 #define SERIAL_ECHOPAIR(name,value) (serial_echopair_P(PSTR(name),(value)))
88 88
 
89
+#define SERIAL_EOL SERIAL_ECHOLN("")
90
+
89 91
 void serial_echopair_P(const char *s_P, float v);
90 92
 void serial_echopair_P(const char *s_P, double v);
91 93
 void serial_echopair_P(const char *s_P, unsigned long v);

+ 2
- 2
Marlin/Marlin_main.cpp View File

@@ -164,7 +164,7 @@
164 164
 // M500 - stores parameters in EEPROM
165 165
 // M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
166 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 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 169
 // M600 - Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal]
170 170
 // M665 - set delta configurations
@@ -3581,7 +3581,7 @@ case 404:  //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp
3581 3581
     break;
3582 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 3586
     break;
3587 3587
     #ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED

+ 2
- 0
Marlin/language.h View File

@@ -155,6 +155,8 @@
155 155
 #define MSG_BABYSTEPPING_Z                  "Babystepping Z"
156 156
 #define MSG_SERIAL_ERROR_MENU_STRUCTURE     "Error in menu structure"
157 157
 
158
+#define MSG_ERR_EEPROM_WRITE                "Error writing to EEPROM!"
159
+
158 160
 // LCD Menu Messages
159 161
 
160 162
 #include LANGUAGE_INCLUDE

Loading…
Cancel
Save