Browse Source

Correct EEPROM read/write disparities. (#12169)

Roman Moravčík 6 years ago
parent
commit
d801f85963
2 changed files with 20 additions and 21 deletions
  1. 13
    16
      Marlin/src/module/configuration_store.cpp
  2. 7
    5
      Marlin/src/module/tool_change.h

+ 13
- 16
Marlin/src/module/configuration_store.cpp View File

@@ -37,7 +37,7 @@
37 37
  */
38 38
 
39 39
 // Change EEPROM version if the structure changes
40
-#define EEPROM_VERSION "V61"
40
+#define EEPROM_VERSION "V62"
41 41
 #define EEPROM_OFFSET 100
42 42
 
43 43
 // Check the integrity of data offsets.
@@ -194,10 +194,8 @@ typedef struct SettingsDataStruct {
194 194
   #elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || Z_MULTI_ENDSTOPS
195 195
     float x2_endstop_adj,                               // M666 X
196 196
           y2_endstop_adj,                               // M666 Y
197
-          z2_endstop_adj;                               // M666 Z
198
-    #if ENABLED(Z_TRIPLE_ENDSTOPS)
199
-      float z3_endstop_adj;                             // M666 Z
200
-    #endif
197
+          z2_endstop_adj,                               // M666 Z (S2)
198
+          z3_endstop_adj;                               // M666 Z (S3)
201 199
   #endif
202 200
 
203 201
   //
@@ -939,7 +937,7 @@ void MarlinSettings::postprocess() {
939 937
     // SINGLENOZZLE
940 938
     //
941 939
 
942
-    #if ENABLED(SINGLENOZZLE)
940
+    #if EXTRUDERS > 1
943 941
       _FIELD_TEST(toolchange_settings);
944 942
       EEPROM_WRITE(toolchange_settings);
945 943
     #endif
@@ -1567,7 +1565,7 @@ void MarlinSettings::postprocess() {
1567 1565
       //
1568 1566
       // SINGLENOZZLE toolchange values
1569 1567
       //
1570
-      #if ENABLED(SINGLENOZZLE)
1568
+      #if EXTRUDERS > 1
1571 1569
         _FIELD_TEST(toolchange_settings);
1572 1570
         EEPROM_READ(toolchange_settings);
1573 1571
       #endif
@@ -1831,16 +1829,15 @@ void MarlinSettings::reset(PORTARG_SOLO) {
1831 1829
   #endif
1832 1830
 
1833 1831
   #if EXTRUDERS > 1
1834
-    toolchange_settings.z_raise = TOOLCHANGE_ZRAISE;
1835
-  #endif
1836
-  
1837
-  #if ENABLED(SINGLENOZZLE)
1838
-    toolchange_settings.swap_length = SINGLENOZZLE_SWAP_LENGTH;
1839
-    toolchange_settings.prime_speed = SINGLENOZZLE_SWAP_PRIME_SPEED;
1840
-    toolchange_settings.retract_speed = SINGLENOZZLE_SWAP_RETRACT_SPEED;
1841
-    #if ENABLED(SINGLENOZZLE_SWAP_PARK)
1842
-      toolchange_settings.change_point = SINGLENOZZLE_TOOLCHANGE_XY;
1832
+    #if ENABLED(SINGLENOZZLE)
1833
+      toolchange_settings.swap_length = SINGLENOZZLE_SWAP_LENGTH;
1834
+      toolchange_settings.prime_speed = SINGLENOZZLE_SWAP_PRIME_SPEED;
1835
+      toolchange_settings.retract_speed = SINGLENOZZLE_SWAP_RETRACT_SPEED;
1836
+      #if ENABLED(SINGLENOZZLE_SWAP_PARK)
1837
+        toolchange_settings.change_point = SINGLENOZZLE_TOOLCHANGE_XY;
1838
+      #endif
1843 1839
     #endif
1840
+    toolchange_settings.z_raise = TOOLCHANGE_ZRAISE;
1844 1841
   #endif
1845 1842
 
1846 1843
   //

+ 7
- 5
Marlin/src/module/tool_change.h View File

@@ -26,12 +26,14 @@
26 26
 #if EXTRUDERS > 1
27 27
 
28 28
   typedef struct {
29
-    float swap_length;
30
-    int16_t prime_speed, retract_speed;
31
-    #if ENABLED(SINGLENOZZLE_SWAP_PARK)
32
-      struct { float x, y; } change_point;
29
+    #if ENABLED(SINGLENOZZLE)
30
+      float swap_length;
31
+      int16_t prime_speed, retract_speed;
32
+      #if ENABLED(SINGLENOZZLE_SWAP_PARK)
33
+        struct { float x, y; } change_point;
34
+      #endif
33 35
     #endif
34
-    float z_raise = TOOLCHANGE_ZRAISE;
36
+    float z_raise;
35 37
   } toolchange_settings_t;
36 38
 
37 39
   extern toolchange_settings_t toolchange_settings;

Loading…
Cancel
Save