Browse Source

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 12 years ago
parent
commit
adee81170d
1 changed files with 11 additions and 1 deletions
  1. 11
    1
      Marlin/EEPROMwrite.h

+ 11
- 1
Marlin/EEPROMwrite.h View File

38
 // the default values are used whenever there is a change to the data, to prevent
38
 // the default values are used whenever there is a change to the data, to prevent
39
 // wrong data being written to the variables.
39
 // wrong data being written to the variables.
40
 // ALSO:  always make sure the variables in the Store and retrieve sections are in the same order.
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
 inline void EEPROM_StoreSettings() 
43
 inline void EEPROM_StoreSettings() 
44
 {
44
 {
57
   EEPROM_writeAnything(i,max_xy_jerk);
57
   EEPROM_writeAnything(i,max_xy_jerk);
58
   EEPROM_writeAnything(i,max_z_jerk);
58
   EEPROM_writeAnything(i,max_z_jerk);
59
   EEPROM_writeAnything(i,max_e_jerk);
59
   EEPROM_writeAnything(i,max_e_jerk);
60
+  EEPROM_writeAnything(i,add_homeing);
60
   #ifdef PIDTEMP
61
   #ifdef PIDTEMP
61
     EEPROM_writeAnything(i,Kp);
62
     EEPROM_writeAnything(i,Kp);
62
     EEPROM_writeAnything(i,Ki);
63
     EEPROM_writeAnything(i,Ki);
119
       SERIAL_ECHOPAIR(" Z" ,max_z_jerk);
120
       SERIAL_ECHOPAIR(" Z" ,max_z_jerk);
120
       SERIAL_ECHOPAIR(" E" ,max_e_jerk);
121
       SERIAL_ECHOPAIR(" E" ,max_e_jerk);
121
       SERIAL_ECHOLN(""); 
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
     #ifdef PIDTEMP
130
     #ifdef PIDTEMP
123
       SERIAL_ECHO_START;
131
       SERIAL_ECHO_START;
124
       SERIAL_ECHOLNPGM("PID settings:");
132
       SERIAL_ECHOLNPGM("PID settings:");
153
       EEPROM_readAnything(i,max_xy_jerk);
161
       EEPROM_readAnything(i,max_xy_jerk);
154
       EEPROM_readAnything(i,max_z_jerk);
162
       EEPROM_readAnything(i,max_z_jerk);
155
       EEPROM_readAnything(i,max_e_jerk);
163
       EEPROM_readAnything(i,max_e_jerk);
164
+      EEPROM_readAnything(i,add_homeing);
156
       #ifndef PIDTEMP
165
       #ifndef PIDTEMP
157
         float Kp,Ki,Kd;
166
         float Kp,Ki,Kd;
158
       #endif
167
       #endif
183
       max_xy_jerk=DEFAULT_XYJERK;
192
       max_xy_jerk=DEFAULT_XYJERK;
184
       max_z_jerk=DEFAULT_ZJERK;
193
       max_z_jerk=DEFAULT_ZJERK;
185
       max_e_jerk=DEFAULT_EJERK;
194
       max_e_jerk=DEFAULT_EJERK;
195
+      add_homeing[0] = add_homeing[1] = add_homeing[2] = 0;
186
       SERIAL_ECHO_START;
196
       SERIAL_ECHO_START;
187
       SERIAL_ECHOLN("Using Default settings:");
197
       SERIAL_ECHOLN("Using Default settings:");
188
     }
198
     }

Loading…
Cancel
Save