Procházet zdrojové kódy

M206: save values in eeprom

Really, we should have a way to adjust the XYZ homing of a machine in
the eeprom.  So as the second stage of this, make the M206 home offset
parameters subject to the M500/M501/M502/M503 eeprom commands.

Bump the eeprom version to "V06".

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson před 12 roky
rodič
revize
adee81170d
1 změnil soubory, kde provedl 11 přidání a 1 odebrání
  1. 11
    1
      Marlin/EEPROMwrite.h

+ 11
- 1
Marlin/EEPROMwrite.h Zobrazit soubor

@@ -38,7 +38,7 @@ template <class T> int EEPROM_readAnything(int &ee, T& value)
38 38
 // the default values are used whenever there is a change to the data, to prevent
39 39
 // wrong data being written to the variables.
40 40
 // ALSO:  always make sure the variables in the Store and retrieve sections are in the same order.
41
-#define EEPROM_VERSION "V05"  
41
+#define EEPROM_VERSION "V06"
42 42
 
43 43
 inline void EEPROM_StoreSettings() 
44 44
 {
@@ -57,6 +57,7 @@ inline void EEPROM_StoreSettings()
57 57
   EEPROM_writeAnything(i,max_xy_jerk);
58 58
   EEPROM_writeAnything(i,max_z_jerk);
59 59
   EEPROM_writeAnything(i,max_e_jerk);
60
+  EEPROM_writeAnything(i,add_homeing);
60 61
   #ifdef PIDTEMP
61 62
     EEPROM_writeAnything(i,Kp);
62 63
     EEPROM_writeAnything(i,Ki);
@@ -119,6 +120,13 @@ inline void EEPROM_printSettings()
119 120
       SERIAL_ECHOPAIR(" Z" ,max_z_jerk);
120 121
       SERIAL_ECHOPAIR(" E" ,max_e_jerk);
121 122
       SERIAL_ECHOLN(""); 
123
+    SERIAL_ECHO_START;
124
+      SERIAL_ECHOLNPGM("Home offset (mm):");
125
+      SERIAL_ECHO_START;
126
+      SERIAL_ECHOPAIR("  M206 X",add_homeing[0] );
127
+      SERIAL_ECHOPAIR(" Y" ,add_homeing[1] );
128
+      SERIAL_ECHOPAIR(" Z" ,add_homeing[2] );
129
+      SERIAL_ECHOLN("");
122 130
     #ifdef PIDTEMP
123 131
       SERIAL_ECHO_START;
124 132
       SERIAL_ECHOLNPGM("PID settings:");
@@ -153,6 +161,7 @@ inline void EEPROM_RetrieveSettings(bool def=false)
153 161
       EEPROM_readAnything(i,max_xy_jerk);
154 162
       EEPROM_readAnything(i,max_z_jerk);
155 163
       EEPROM_readAnything(i,max_e_jerk);
164
+      EEPROM_readAnything(i,add_homeing);
156 165
       #ifndef PIDTEMP
157 166
         float Kp,Ki,Kd;
158 167
       #endif
@@ -183,6 +192,7 @@ inline void EEPROM_RetrieveSettings(bool def=false)
183 192
       max_xy_jerk=DEFAULT_XYJERK;
184 193
       max_z_jerk=DEFAULT_ZJERK;
185 194
       max_e_jerk=DEFAULT_EJERK;
195
+      add_homeing[0] = add_homeing[1] = add_homeing[2] = 0;
186 196
       SERIAL_ECHO_START;
187 197
       SERIAL_ECHOLN("Using Default settings:");
188 198
     }

Loading…
Zrušit
Uložit