浏览代码

Merge pull request #6283 from thinkyhead/rc_eeprom_z_fade

Save / restore z_fade_height in EEPROM
Scott Lahteine 8 年前
父节点
当前提交
67fb7f82ac

+ 4
- 0
Marlin/Marlin.h 查看文件

@@ -307,6 +307,10 @@ float code_value_temp_diff();
307 307
   void reset_bed_level();
308 308
 #endif
309 309
 
310
+#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
311
+  void set_z_fade_height(const float zfh);
312
+#endif
313
+
310 314
 #if ENABLED(Z_DUAL_ENDSTOPS)
311 315
   extern float z_endstop_adj;
312 316
 #endif

+ 6
- 6
Marlin/Marlin_main.cpp 查看文件

@@ -573,7 +573,7 @@ static uint8_t target_extruder;
573 573
         endstop_adj[ABC] = { 0 };
574 574
 
575 575
   // These values are loaded or reset at boot time when setup() calls
576
-  // Config_RetrieveSettings(), which calls recalc_delta_settings().
576
+  // settings.load(), which calls recalc_delta_settings().
577 577
   float delta_radius,
578 578
         delta_tower_angle_trim[ABC],
579 579
         delta_tower[ABC][2],
@@ -7898,28 +7898,28 @@ void quickstop_stepper() {
7898 7898
  * M500: Store settings in EEPROM
7899 7899
  */
7900 7900
 inline void gcode_M500() {
7901
-  (void)Config_StoreSettings();
7901
+  (void)settings.save();
7902 7902
 }
7903 7903
 
7904 7904
 /**
7905 7905
  * M501: Read settings from EEPROM
7906 7906
  */
7907 7907
 inline void gcode_M501() {
7908
-  (void)Config_RetrieveSettings();
7908
+  (void)settings.load();
7909 7909
 }
7910 7910
 
7911 7911
 /**
7912 7912
  * M502: Revert to default settings
7913 7913
  */
7914 7914
 inline void gcode_M502() {
7915
-  (void)Config_ResetDefault();
7915
+  (void)settings.reset();
7916 7916
 }
7917 7917
 
7918 7918
 /**
7919 7919
  * M503: print settings currently in memory
7920 7920
  */
7921 7921
 inline void gcode_M503() {
7922
-  (void)Config_PrintSettings(code_seen('S') && !code_value_bool());
7922
+  (void)settings.report(code_seen('S') && !code_value_bool());
7923 7923
 }
7924 7924
 
7925 7925
 #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
@@ -11343,7 +11343,7 @@ void setup() {
11343 11343
 
11344 11344
   // Load data from EEPROM if available (or use defaults)
11345 11345
   // This also updates variables in the planner, elsewhere
11346
-  (void)Config_RetrieveSettings();
11346
+  (void)settings.load();
11347 11347
 
11348 11348
   #if DISABLED(NO_WORKSPACE_OFFSETS)
11349 11349
     // Initialize current position based on home_offset

+ 117
- 55
Marlin/configuration_store.cpp 查看文件

@@ -23,7 +23,7 @@
23 23
 /**
24 24
  * configuration_store.cpp
25 25
  *
26
- * Configuration and EEPROM storage
26
+ * Settings and EEPROM storage
27 27
  *
28 28
  * IMPORTANT:  Whenever there are changes made to the variables stored in EEPROM
29 29
  * in the functions below, also increment the version number. This makes sure that
@@ -36,13 +36,13 @@
36 36
  *
37 37
  */
38 38
 
39
-#define EEPROM_VERSION "V32"
39
+#define EEPROM_VERSION "V33"
40 40
 
41 41
 // Change EEPROM version if these are changed:
42 42
 #define EEPROM_OFFSET 100
43 43
 
44 44
 /**
45
- * V32 EEPROM Layout:
45
+ * V33 EEPROM Layout:
46 46
  *
47 47
  *  100  Version                                    (char x4)
48 48
  *  104  EEPROM Checksum                            (uint16_t)
@@ -64,25 +64,28 @@
64 64
  *  195  M206 XYZ  home_offset                      (float x3)
65 65
  *  207  M218 XYZ  hotend_offset                    (float x3 per additional hotend)
66 66
  *
67
+ * Global Leveling:
68
+ *  219            z_fade_height                    (float)
69
+ *
67 70
  * Mesh bed leveling:                               43 bytes
68
- *  219  M420 S    from mbl.status                  (bool)
69
- *  220            mbl.z_offset                     (float)
70
- *  224            GRID_MAX_POINTS_X                (uint8_t)
71
- *  225            GRID_MAX_POINTS_Y                (uint8_t)
72
- *  226 G29 S3 XYZ z_values[][]                     (float x9, up to float x 81) +288
71
+ *  223  M420 S    from mbl.status                  (bool)
72
+ *  224            mbl.z_offset                     (float)
73
+ *  228            GRID_MAX_POINTS_X                (uint8_t)
74
+ *  229            GRID_MAX_POINTS_Y                (uint8_t)
75
+ *  230 G29 S3 XYZ z_values[][]                     (float x9, up to float x 81) +288
73 76
  *
74 77
  * AUTO BED LEVELING                                4 bytes
75
- *  262  M851      zprobe_zoffset                   (float)
78
+ *  266  M851      zprobe_zoffset                   (float)
76 79
  *
77 80
  * ABL_PLANAR (or placeholder):                     36 bytes
78
- *  266            planner.bed_level_matrix         (matrix_3x3 = float x9)
81
+ *  270            planner.bed_level_matrix         (matrix_3x3 = float x9)
79 82
  *
80 83
  * AUTO_BED_LEVELING_BILINEAR (or placeholder):     47 bytes
81
- *  302            GRID_MAX_POINTS_X                (uint8_t)
82
- *  303            GRID_MAX_POINTS_Y                (uint8_t)
83
- *  304            bilinear_grid_spacing            (int x2)
84
- *  308  G29 L F   bilinear_start                   (int x2)
85
- *  312            bed_level_grid[][]               (float x9, up to float x256) +988
84
+ *  306            GRID_MAX_POINTS_X                (uint8_t)
85
+ *  307            GRID_MAX_POINTS_Y                (uint8_t)
86
+ *  308            bilinear_grid_spacing            (int x2)
87
+ *  312  G29 L F   bilinear_start                   (int x2)
88
+ *  316            bed_level_grid[][]               (float x9, up to float x256) +988
86 89
  *
87 90
  * DELTA (if deltabot):                             48 bytes
88 91
  *  348  M666 XYZ  endstop_adj                      (float x3)
@@ -144,18 +147,21 @@
144 147
  *  568  M906 E1   stepperE1 current                (uint16_t)
145 148
  *  570  M906 E2   stepperE2 current                (uint16_t)
146 149
  *  572  M906 E3   stepperE3 current                (uint16_t)
147
- *  572  M906 E4   stepperE4 current                (uint16_t)
150
+ *  576  M906 E4   stepperE4 current                (uint16_t)
148 151
  *
149
- *  576                                Minimum end-point
150
- * 1897 (576 + 36 + 9 + 288 + 988)     Maximum end-point
152
+ *  580                                Minimum end-point
153
+ * 1901 (580 + 36 + 9 + 288 + 988)     Maximum end-point
151 154
  */
155
+#include "configuration_store.h"
156
+
157
+MarlinSettings settings;
158
+
152 159
 #include "Marlin.h"
153 160
 #include "language.h"
154 161
 #include "endstops.h"
155 162
 #include "planner.h"
156 163
 #include "temperature.h"
157 164
 #include "ultralcd.h"
158
-#include "configuration_store.h"
159 165
 
160 166
 #if ENABLED(MESH_BED_LEVELING)
161 167
   #include "mesh_bed_leveling.h"
@@ -176,7 +182,7 @@
176 182
 /**
177 183
  * Post-process after Retrieve or Reset
178 184
  */
179
-void Config_Postprocess() {
185
+void MarlinSettings::postprocess() {
180 186
   // steps per s2 needs to be updated to agree with units per s2
181 187
   planner.reset_acceleration_rates();
182 188
 
@@ -200,16 +206,28 @@ void Config_Postprocess() {
200 206
     // Software endstops depend on home_offset
201 207
     LOOP_XYZ(i) update_software_endstops((AxisEnum)i);
202 208
   #endif
209
+
210
+  #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
211
+    set_z_fade_height(
212
+      //#if ENABLED(AUTO_BED_LEVELING_UBL)
213
+      //  ubl.state.g29_correction_fade_height
214
+      //#else
215
+        planner.z_fade_height
216
+      //#endif
217
+    );
218
+  #endif
203 219
 }
204 220
 
205 221
 #if ENABLED(EEPROM_SETTINGS)
206 222
 
207
-  uint16_t eeprom_checksum;
208 223
   const char version[4] = EEPROM_VERSION;
209 224
 
210
-  bool eeprom_write_error;
225
+  uint16_t MarlinSettings::eeprom_checksum;
211 226
 
212
-  void _EEPROM_writeData(int &pos, const uint8_t* value, uint16_t size) {
227
+  bool MarlinSettings::eeprom_write_error,
228
+       MarlinSettings::eeprom_read_error;
229
+
230
+  void MarlinSettings::write_data(int &pos, const uint8_t* value, uint16_t size) {
213 231
     if (eeprom_write_error) return;
214 232
     while (size--) {
215 233
       uint8_t * const p = (uint8_t * const)pos;
@@ -230,8 +248,7 @@ void Config_Postprocess() {
230 248
       value++;
231 249
     };
232 250
   }
233
-  bool eeprom_read_error;
234
-  void _EEPROM_readData(int &pos, uint8_t* value, uint16_t size) {
251
+  void MarlinSettings::read_data(int &pos, uint8_t* value, uint16_t size) {
235 252
     do {
236 253
       uint8_t c = eeprom_read_byte((unsigned char*)pos);
237 254
       if (!eeprom_read_error) *value = c;
@@ -244,14 +261,14 @@ void Config_Postprocess() {
244 261
   #define DUMMY_PID_VALUE 3000.0f
245 262
   #define EEPROM_START() int eeprom_index = EEPROM_OFFSET
246 263
   #define EEPROM_SKIP(VAR) eeprom_index += sizeof(VAR)
247
-  #define EEPROM_WRITE(VAR) _EEPROM_writeData(eeprom_index, (uint8_t*)&VAR, sizeof(VAR))
248
-  #define EEPROM_READ(VAR) _EEPROM_readData(eeprom_index, (uint8_t*)&VAR, sizeof(VAR))
249
-  #define EEPROM_ASSERT(TST,ERR) if () do{ SERIAL_ERROR_START; SERIAL_ERRORLNPGM(ERR); eeprom_read_error |= true; }while(0)
264
+  #define EEPROM_WRITE(VAR) write_data(eeprom_index, (uint8_t*)&VAR, sizeof(VAR))
265
+  #define EEPROM_READ(VAR) read_data(eeprom_index, (uint8_t*)&VAR, sizeof(VAR))
266
+  #define EEPROM_ASSERT(TST,ERR) if (!(TST)) do{ SERIAL_ERROR_START; SERIAL_ERRORLNPGM(ERR); eeprom_read_error = true; }while(0)
250 267
 
251 268
   /**
252 269
    * M500 - Store Configuration
253 270
    */
254
-  bool Config_StoreSettings() {
271
+  bool MarlinSettings::save() {
255 272
     float dummy = 0.0f;
256 273
     char ver[4] = "000";
257 274
 
@@ -290,6 +307,17 @@ void Config_Postprocess() {
290 307
     #endif
291 308
 
292 309
     //
310
+    // General Leveling
311
+    //
312
+
313
+    #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
314
+      EEPROM_WRITE(planner.z_fade_height);
315
+    #else
316
+      dummy = 10.0;
317
+      EEPROM_WRITE(dummy);
318
+    #endif
319
+
320
+    //
293 321
     // Mesh Bed Leveling
294 322
     //
295 323
 
@@ -552,7 +580,7 @@ void Config_Postprocess() {
552 580
   /**
553 581
    * M501 - Retrieve Configuration
554 582
    */
555
-  bool Config_RetrieveSettings() {
583
+  bool MarlinSettings::load() {
556 584
 
557 585
     EEPROM_START();
558 586
     eeprom_read_error = false; // If set EEPROM_READ won't write into RAM
@@ -573,7 +601,7 @@ void Config_Postprocess() {
573 601
       SERIAL_ECHOPGM("EEPROM version mismatch ");
574 602
       SERIAL_ECHOPAIR("(EEPROM=", stored_ver);
575 603
       SERIAL_ECHOLNPGM(" Marlin=" EEPROM_VERSION ")");
576
-      Config_ResetDefault();
604
+      reset();
577 605
     }
578 606
     else {
579 607
       float dummy = 0;
@@ -619,6 +647,16 @@ void Config_Postprocess() {
619 647
       #endif
620 648
 
621 649
       //
650
+      // General Leveling
651
+      //
652
+
653
+      #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
654
+        EEPROM_READ(planner.z_fade_height);
655
+      #else
656
+        EEPROM_READ(dummy);
657
+      #endif
658
+
659
+      //
622 660
       // Mesh (Manual) Bed Leveling
623 661
       //
624 662
 
@@ -713,6 +751,11 @@ void Config_Postprocess() {
713 751
       EEPROM_READ(lcd_preheat_bed_temp);
714 752
       EEPROM_READ(lcd_preheat_fan_speed);
715 753
 
754
+      //EEPROM_ASSERT(
755
+      //  WITHIN(lcd_preheat_fan_speed, 0, 255),
756
+      //  "lcd_preheat_fan_speed out of range"
757
+      //);
758
+
716 759
       #if ENABLED(PIDTEMP)
717 760
         for (uint8_t e = 0; e < MAX_EXTRUDERS; e++) {
718 761
           EEPROM_READ(dummy); // Kp
@@ -835,9 +878,9 @@ void Config_Postprocess() {
835 878
 
836 879
       if (eeprom_checksum == stored_checksum) {
837 880
         if (eeprom_read_error)
838
-          Config_ResetDefault();
881
+          reset();
839 882
         else {
840
-          Config_Postprocess();
883
+          postprocess();
841 884
           SERIAL_ECHO_START;
842 885
           SERIAL_ECHO(version);
843 886
           SERIAL_ECHOPAIR(" stored settings retrieved (", eeprom_index - (EEPROM_OFFSET));
@@ -847,7 +890,7 @@ void Config_Postprocess() {
847 890
       else {
848 891
         SERIAL_ERROR_START;
849 892
         SERIAL_ERRORLNPGM("EEPROM checksum mismatch");
850
-        Config_ResetDefault();
893
+        reset();
851 894
       }
852 895
 
853 896
       #if ENABLED(AUTO_BED_LEVELING_UBL)
@@ -889,7 +932,7 @@ void Config_Postprocess() {
889 932
       #endif
890 933
     }
891 934
     #if ENABLED(EEPROM_CHITCHAT)
892
-      Config_PrintSettings();
935
+      report();
893 936
     #endif
894 937
 
895 938
     return !eeprom_read_error;
@@ -897,7 +940,7 @@ void Config_Postprocess() {
897 940
 
898 941
 #else // !EEPROM_SETTINGS
899 942
 
900
-  bool Config_StoreSettings() {
943
+  bool MarlinSettings::save() {
901 944
     SERIAL_ERROR_START;
902 945
     SERIAL_ERRORLNPGM("EEPROM disabled");
903 946
     return false;
@@ -908,7 +951,7 @@ void Config_Postprocess() {
908 951
 /**
909 952
  * M502 - Reset Configuration
910 953
  */
911
-void Config_ResetDefault() {
954
+void MarlinSettings::reset() {
912 955
   const float tmp1[] = DEFAULT_AXIS_STEPS_PER_UNIT, tmp2[] = DEFAULT_MAX_FEEDRATE;
913 956
   const uint32_t tmp3[] = DEFAULT_MAX_ACCELERATION;
914 957
   LOOP_XYZE_N(i) {
@@ -927,6 +970,11 @@ void Config_ResetDefault() {
927 970
   planner.max_jerk[Y_AXIS] = DEFAULT_YJERK;
928 971
   planner.max_jerk[Z_AXIS] = DEFAULT_ZJERK;
929 972
   planner.max_jerk[E_AXIS] = DEFAULT_EJERK;
973
+
974
+  #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
975
+    planner.z_fade_height = 0.0;
976
+  #endif
977
+
930 978
   #if DISABLED(NO_WORKSPACE_OFFSETS)
931 979
     ZERO(home_offset);
932 980
   #endif
@@ -968,11 +1016,13 @@ void Config_ResetDefault() {
968 1016
     COPY(delta_diagonal_rod_trim, drt);
969 1017
     COPY(delta_tower_angle_trim, dta);
970 1018
   #elif ENABLED(Z_DUAL_ENDSTOPS)
971
-    #if defined(Z_DUAL_ENDSTOPS_ADJUSTMENT)
972
-      float z_endstop_adj = Z_DUAL_ENDSTOPS_ADJUSTMENT;
973
-    #else
974
-      float z_endstop_adj = 0;
975
-    #endif
1019
+    float z_endstop_adj =
1020
+      #ifdef Z_DUAL_ENDSTOPS_ADJUSTMENT
1021
+        Z_DUAL_ENDSTOPS_ADJUSTMENT
1022
+      #else
1023
+        0
1024
+      #endif
1025
+    ;
976 1026
   #endif
977 1027
 
978 1028
   #if ENABLED(ULTIPANEL)
@@ -1027,11 +1077,11 @@ void Config_ResetDefault() {
1027 1077
   #endif
1028 1078
 
1029 1079
   volumetric_enabled =
1030
-  #if ENABLED(VOLUMETRIC_DEFAULT_ON)
1031
-    true
1032
-  #else
1033
-    false
1034
-  #endif
1080
+    #if ENABLED(VOLUMETRIC_DEFAULT_ON)
1081
+      true
1082
+    #else
1083
+      false
1084
+    #endif
1035 1085
   ;
1036 1086
   for (uint8_t q = 0; q < COUNT(filament_size); q++)
1037 1087
     filament_size[q] = DEFAULT_NOMINAL_FILAMENT_DIA;
@@ -1077,7 +1127,7 @@ void Config_ResetDefault() {
1077 1127
     #endif
1078 1128
   #endif
1079 1129
 
1080
-  Config_Postprocess();
1130
+  postprocess();
1081 1131
 
1082 1132
   SERIAL_ECHO_START;
1083 1133
   SERIAL_ECHOLNPGM("Hardcoded Default Settings Loaded");
@@ -1088,10 +1138,11 @@ void Config_ResetDefault() {
1088 1138
   #define CONFIG_ECHO_START do{ if (!forReplay) SERIAL_ECHO_START; }while(0)
1089 1139
 
1090 1140
   /**
1091
-   * M503 - Print Configuration
1141
+   * M503 - Report current settings in RAM
1142
+   *   
1143
+   * Unless specifically disabled, M503 is available even without EEPROM
1092 1144
    */
1093
-  void Config_PrintSettings(bool forReplay) {
1094
-    // Always have this function, even with EEPROM_SETTINGS disabled, the current values will be shown
1145
+  void MarlinSettings::report(bool forReplay) {
1095 1146
 
1096 1147
     CONFIG_ECHO_START;
1097 1148
 
@@ -1211,7 +1262,11 @@ void Config_ResetDefault() {
1211 1262
         SERIAL_ECHOLNPGM("Mesh Bed Leveling:");
1212 1263
         CONFIG_ECHO_START;
1213 1264
       }
1214
-      SERIAL_ECHOLNPAIR("  M420 S", mbl.has_mesh() ? 1 : 0);
1265
+      SERIAL_ECHOPAIR("  M420 S", mbl.has_mesh() ? 1 : 0);
1266
+      #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
1267
+        SERIAL_ECHOLNPAIR(" Z", planner.z_fade_height);
1268
+      #endif
1269
+      SERIAL_EOL;
1215 1270
       for (uint8_t py = 1; py <= GRID_MAX_POINTS_Y; py++) {
1216 1271
         for (uint8_t px = 1; px <= GRID_MAX_POINTS_X; px++) {
1217 1272
           CONFIG_ECHO_START;
@@ -1229,8 +1284,11 @@ void Config_ResetDefault() {
1229 1284
         SERIAL_ECHOLNPGM("Unified Bed Leveling:");
1230 1285
         CONFIG_ECHO_START;
1231 1286
       }
1232
-
1233
-      SERIAL_ECHOLNPAIR("  M420 S", ubl.state.active ? 1 : 0);
1287
+      SERIAL_ECHOPAIR("  M420 S", ubl.state.active ? 1 : 0);
1288
+      //#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
1289
+      //  SERIAL_ECHOLNPAIR(" Z", ubl.state.g29_correction_fade_height);
1290
+      //#endif
1291
+      SERIAL_EOL;
1234 1292
 
1235 1293
       if (!forReplay) {
1236 1294
         SERIAL_ECHOPGM("\nUBL is ");
@@ -1264,7 +1322,11 @@ void Config_ResetDefault() {
1264 1322
         SERIAL_ECHOLNPGM("Auto Bed Leveling:");
1265 1323
         CONFIG_ECHO_START;
1266 1324
       }
1267
-      SERIAL_ECHOLNPAIR("  M420 S", planner.abl_enabled ? 1 : 0);
1325
+      SERIAL_ECHOPAIR("  M420 S", planner.abl_enabled ? 1 : 0);
1326
+      #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
1327
+        SERIAL_ECHOLNPAIR(" Z", planner.z_fade_height);
1328
+      #endif
1329
+      SERIAL_EOL;
1268 1330
 
1269 1331
     #endif
1270 1332
 

+ 35
- 16
Marlin/configuration_store.h 查看文件

@@ -25,19 +25,38 @@
25 25
 
26 26
 #include "MarlinConfig.h"
27 27
 
28
-void Config_ResetDefault();
29
-bool Config_StoreSettings();
30
-
31
-#if DISABLED(DISABLE_M503)
32
-  void Config_PrintSettings(bool forReplay=false);
33
-#else
34
-  FORCE_INLINE void Config_PrintSettings(bool forReplay=false) {}
35
-#endif
36
-
37
-#if ENABLED(EEPROM_SETTINGS)
38
-  bool Config_RetrieveSettings();
39
-#else
40
-  FORCE_INLINE bool Config_RetrieveSettings() { Config_ResetDefault(); Config_PrintSettings(); return true; }
41
-#endif
42
-
43
-#endif //CONFIGURATION_STORE_H
28
+class MarlinSettings {
29
+  public:
30
+    MarlinSettings() { }
31
+
32
+    static void reset();
33
+    static bool save();
34
+
35
+    #if ENABLED(EEPROM_SETTINGS)
36
+      static bool load();
37
+    #else
38
+      FORCE_INLINE
39
+      static bool load() { reset(); report(); return true; }
40
+    #endif
41
+
42
+    #if DISABLED(DISABLE_M503)
43
+      static void report(bool forReplay=false);
44
+    #else
45
+      FORCE_INLINE
46
+      static void report(bool forReplay=false) { }
47
+    #endif
48
+
49
+  private:
50
+    static void postprocess();
51
+
52
+    #if ENABLED(EEPROM_SETTINGS)
53
+      static uint16_t eeprom_checksum;
54
+      static bool eeprom_read_error, eeprom_write_error;
55
+      static void write_data(int &pos, const uint8_t* value, uint16_t size);
56
+      static void read_data(int &pos, uint8_t* value, uint16_t size);
57
+    #endif
58
+};
59
+
60
+extern MarlinSettings settings;
61
+
62
+#endif // CONFIGURATION_STORE_H

+ 1
- 1
Marlin/example_configurations/delta/kossel_pro/Configuration.h 查看文件

@@ -816,7 +816,7 @@
816 816
  */
817 817
 #define Z_CLEARANCE_DEPLOY_PROBE   100 // Z Clearance for Deploy/Stow
818 818
 #define Z_CLEARANCE_BETWEEN_PROBES   5 // Z Clearance between probe points
819
- 
819
+
820 820
 // For M851 give a range for adjusting the Z probe offset
821 821
 
822 822
 #define Z_PROBE_OFFSET_RANGE_MIN -15

+ 2
- 2
Marlin/planner.cpp 查看文件

@@ -109,8 +109,8 @@ float Planner::min_feedrate_mm_s,
109 109
 #endif
110 110
 
111 111
 #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
112
-  float Planner::z_fade_height = 0.0,
113
-        Planner::inverse_z_fade_height = 0.0;
112
+  float Planner::z_fade_height,
113
+        Planner::inverse_z_fade_height;
114 114
 #endif
115 115
 
116 116
 #if ENABLED(AUTOTEMP)

+ 3
- 3
Marlin/ultralcd.cpp 查看文件

@@ -2046,12 +2046,12 @@ void kill_screen(const char* lcd_msg) {
2046 2046
    */
2047 2047
 
2048 2048
   #if ENABLED(EEPROM_SETTINGS)
2049
-    static void lcd_store_settings()   { lcd_completion_feedback(Config_StoreSettings()); }
2050
-    static void lcd_load_settings()    { lcd_completion_feedback(Config_RetrieveSettings()); }
2049
+    static void lcd_store_settings()   { lcd_completion_feedback(settings.save()); }
2050
+    static void lcd_load_settings()    { lcd_completion_feedback(settings.load()); }
2051 2051
   #endif
2052 2052
 
2053 2053
   static void lcd_factory_settings() {
2054
-    Config_ResetDefault();
2054
+    settings.reset();
2055 2055
     lcd_completion_feedback();
2056 2056
   }
2057 2057
 

正在加载...
取消
保存