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
 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
- 0
Marlin/Marlin.h View File

86
 
86
 
87
 #define SERIAL_ECHOPAIR(name,value) (serial_echopair_P(PSTR(name),(value)))
87
 #define SERIAL_ECHOPAIR(name,value) (serial_echopair_P(PSTR(name),(value)))
88
 
88
 
89
+#define SERIAL_EOL SERIAL_ECHOLN("")
90
+
89
 void serial_echopair_P(const char *s_P, float v);
91
 void serial_echopair_P(const char *s_P, float v);
90
 void serial_echopair_P(const char *s_P, double v);
92
 void serial_echopair_P(const char *s_P, double v);
91
 void serial_echopair_P(const char *s_P, unsigned long v);
93
 void serial_echopair_P(const char *s_P, unsigned long v);

+ 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

+ 2
- 0
Marlin/language.h View File

155
 #define MSG_BABYSTEPPING_Z                  "Babystepping Z"
155
 #define MSG_BABYSTEPPING_Z                  "Babystepping Z"
156
 #define MSG_SERIAL_ERROR_MENU_STRUCTURE     "Error in menu structure"
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
 // LCD Menu Messages
160
 // LCD Menu Messages
159
 
161
 
160
 #include LANGUAGE_INCLUDE
162
 #include LANGUAGE_INCLUDE

Loading…
Cancel
Save