|
@@ -17,76 +17,79 @@
|
17
|
17
|
#define EEPROM_VERSION "V21"
|
18
|
18
|
|
19
|
19
|
/**
|
20
|
|
- * V19 EEPROM Layout:
|
|
20
|
+ * V21 EEPROM Layout:
|
21
|
21
|
*
|
22
|
|
- * ver
|
23
|
|
- * M92 XYZE axis_steps_per_unit (x4)
|
24
|
|
- * M203 XYZE max_feedrate (x4)
|
25
|
|
- * M201 XYZE max_acceleration_units_per_sq_second (x4)
|
26
|
|
- * M204 P acceleration
|
27
|
|
- * M204 R retract_acceleration
|
28
|
|
- * M204 T travel_acceleration
|
29
|
|
- * M205 S minimumfeedrate
|
30
|
|
- * M205 T mintravelfeedrate
|
31
|
|
- * M205 B minsegmenttime
|
32
|
|
- * M205 X max_xy_jerk
|
33
|
|
- * M205 Z max_z_jerk
|
34
|
|
- * M205 E max_e_jerk
|
35
|
|
- * M206 XYZ home_offset (x3)
|
|
22
|
+ * 100 Version (char x4)
|
|
23
|
+ *
|
|
24
|
+ * 104 M92 XYZE axis_steps_per_unit (float x4)
|
|
25
|
+ * 120 M203 XYZE max_feedrate (float x4)
|
|
26
|
+ * 136 M201 XYZE max_acceleration_units_per_sq_second (uint32_t x4)
|
|
27
|
+ * 152 M204 P acceleration (float)
|
|
28
|
+ * 156 M204 R retract_acceleration (float)
|
|
29
|
+ * 160 M204 T travel_acceleration (float)
|
|
30
|
+ * 164 M205 S minimumfeedrate (float)
|
|
31
|
+ * 168 M205 T mintravelfeedrate (float)
|
|
32
|
+ * 172 M205 B minsegmenttime (ulong)
|
|
33
|
+ * 176 M205 X max_xy_jerk (float)
|
|
34
|
+ * 180 M205 Z max_z_jerk (float)
|
|
35
|
+ * 184 M205 E max_e_jerk (float)
|
|
36
|
+ * 188 M206 XYZ home_offset (float x3)
|
36
|
37
|
*
|
37
|
38
|
* Mesh bed leveling:
|
38
|
|
- * M420 S active
|
39
|
|
- * mesh_num_x (set in firmware)
|
40
|
|
- * mesh_num_y (set in firmware)
|
41
|
|
- * M421 XYZ z_values[][]
|
42
|
|
- * M851 zprobe_zoffset
|
|
39
|
+ * 200 M420 S active (bool)
|
|
40
|
+ * 201 mesh_num_x (uint8 as set in firmware)
|
|
41
|
+ * 202 mesh_num_y (uint8 as set in firmware)
|
|
42
|
+ * 203 M421 XYZ z_values[][] (float x9, by default)
|
|
43
|
+ * 239 M851 zprobe_zoffset (float)
|
43
|
44
|
*
|
44
|
45
|
* DELTA:
|
45
|
|
- * M666 XYZ endstop_adj (x3)
|
46
|
|
- * M665 R delta_radius
|
47
|
|
- * M665 L delta_diagonal_rod
|
48
|
|
- * M665 S delta_segments_per_second
|
|
46
|
+ * 243 M666 XYZ endstop_adj (float x3)
|
|
47
|
+ * 255 M665 R delta_radius (float)
|
|
48
|
+ * 259 M665 L delta_diagonal_rod (float)
|
|
49
|
+ * 263 M665 S delta_segments_per_second (float)
|
|
50
|
+ *
|
|
51
|
+ * Z_DUAL_ENDSTOPS:
|
|
52
|
+ * 267 M666 Z z_endstop_adj (float)
|
49
|
53
|
*
|
50
|
54
|
* ULTIPANEL:
|
51
|
|
- * M145 S0 H plaPreheatHotendTemp
|
52
|
|
- * M145 S0 B plaPreheatHPBTemp
|
53
|
|
- * M145 S0 F plaPreheatFanSpeed
|
54
|
|
- * M145 S1 H absPreheatHotendTemp
|
55
|
|
- * M145 S1 B absPreheatHPBTemp
|
56
|
|
- * M145 S1 F absPreheatFanSpeed
|
|
55
|
+ * 271 M145 S0 H plaPreheatHotendTemp (int)
|
|
56
|
+ * 273 M145 S0 B plaPreheatHPBTemp (int)
|
|
57
|
+ * 275 M145 S0 F plaPreheatFanSpeed (int)
|
|
58
|
+ * 277 M145 S1 H absPreheatHotendTemp (int)
|
|
59
|
+ * 279 M145 S1 B absPreheatHPBTemp (int)
|
|
60
|
+ * 281 M145 S1 F absPreheatFanSpeed (int)
|
57
|
61
|
*
|
58
|
62
|
* PIDTEMP:
|
59
|
|
- * M301 E0 PIDC Kp[0], Ki[0], Kd[0], Kc[0]
|
60
|
|
- * M301 E1 PIDC Kp[1], Ki[1], Kd[1], Kc[1]
|
61
|
|
- * M301 E2 PIDC Kp[2], Ki[2], Kd[2], Kc[2]
|
62
|
|
- * M301 E3 PIDC Kp[3], Ki[3], Kd[3], Kc[3]
|
63
|
|
- * M301 L lpq_len
|
|
63
|
+ * 283 M301 E0 PIDC Kp[0], Ki[0], Kd[0], Kc[0] (float x4)
|
|
64
|
+ * 299 M301 E1 PIDC Kp[1], Ki[1], Kd[1], Kc[1] (float x4)
|
|
65
|
+ * 315 M301 E2 PIDC Kp[2], Ki[2], Kd[2], Kc[2] (float x4)
|
|
66
|
+ * 331 M301 E3 PIDC Kp[3], Ki[3], Kd[3], Kc[3] (float x4)
|
|
67
|
+ * 347 M301 L lpq_len (int)
|
64
|
68
|
*
|
65
|
69
|
* PIDTEMPBED:
|
66
|
|
- * M304 PID bedKp, bedKi, bedKd
|
|
70
|
+ * 349 M304 PID bedKp, bedKi, bedKd (float x3)
|
67
|
71
|
*
|
68
|
72
|
* DOGLCD:
|
69
|
|
- * M250 C lcd_contrast
|
|
73
|
+ * 361 M250 C lcd_contrast (int)
|
70
|
74
|
*
|
71
|
75
|
* SCARA:
|
72
|
|
- * M365 XYZ axis_scaling (x3)
|
|
76
|
+ * 363 M365 XYZ axis_scaling (float x3)
|
73
|
77
|
*
|
74
|
78
|
* FWRETRACT:
|
75
|
|
- * M209 S autoretract_enabled
|
76
|
|
- * M207 S retract_length
|
77
|
|
- * M207 W retract_length_swap
|
78
|
|
- * M207 F retract_feedrate
|
79
|
|
- * M207 Z retract_zlift
|
80
|
|
- * M208 S retract_recover_length
|
81
|
|
- * M208 W retract_recover_length_swap
|
82
|
|
- * M208 F retract_recover_feedrate
|
|
79
|
+ * 375 M209 S autoretract_enabled (bool)
|
|
80
|
+ * 376 M207 S retract_length (float)
|
|
81
|
+ * 380 M207 W retract_length_swap (float)
|
|
82
|
+ * 384 M207 F retract_feedrate (float)
|
|
83
|
+ * 388 M207 Z retract_zlift (float)
|
|
84
|
+ * 392 M208 S retract_recover_length (float)
|
|
85
|
+ * 396 M208 W retract_recover_length_swap (float)
|
|
86
|
+ * 400 M208 F retract_recover_feedrate (float)
|
83
|
87
|
*
|
84
|
|
- * M200 D volumetric_enabled (D>0 makes this enabled)
|
|
88
|
+ * Volumetric Extrusion:
|
|
89
|
+ * 404 M200 D volumetric_enabled (bool)
|
|
90
|
+ * 405 M200 T D filament_size (float x4) (T0..3)
|
85
|
91
|
*
|
86
|
|
- * M200 T D filament_size (x4) (T0..3)
|
87
|
|
- *
|
88
|
|
- * Z_DUAL_ENDSTOPS:
|
89
|
|
- * M666 Z z_endstop_adj
|
|
92
|
+ * 421 This Slot is Available!
|
90
|
93
|
*
|
91
|
94
|
*/
|
92
|
95
|
#include "Marlin.h"
|
|
@@ -133,6 +136,10 @@ void _EEPROM_readData(int &pos, uint8_t* value, uint8_t size) {
|
133
|
136
|
|
134
|
137
|
#if ENABLED(EEPROM_SETTINGS)
|
135
|
138
|
|
|
139
|
+/**
|
|
140
|
+ * Store Configuration Settings - M500
|
|
141
|
+ */
|
|
142
|
+
|
136
|
143
|
void Config_StoreSettings() {
|
137
|
144
|
float dummy = 0.0f;
|
138
|
145
|
char ver[4] = "000";
|
|
@@ -185,10 +192,10 @@ void Config_StoreSettings() {
|
185
|
192
|
#elif ENABLED(Z_DUAL_ENDSTOPS)
|
186
|
193
|
EEPROM_WRITE_VAR(i, z_endstop_adj); // 1 floats
|
187
|
194
|
dummy = 0.0f;
|
188
|
|
- for (int q = 5; q--;) EEPROM_WRITE_VAR(i, dummy);
|
|
195
|
+ for (uint8_t q = 5; q--;) EEPROM_WRITE_VAR(i, dummy);
|
189
|
196
|
#else
|
190
|
197
|
dummy = 0.0f;
|
191
|
|
- for (int q = 6; q--;) EEPROM_WRITE_VAR(i, dummy);
|
|
198
|
+ for (uint8_t q = 6; q--;) EEPROM_WRITE_VAR(i, dummy);
|
192
|
199
|
#endif
|
193
|
200
|
|
194
|
201
|
#if DISABLED(ULTIPANEL)
|
|
@@ -203,7 +210,7 @@ void Config_StoreSettings() {
|
203
|
210
|
EEPROM_WRITE_VAR(i, absPreheatHPBTemp);
|
204
|
211
|
EEPROM_WRITE_VAR(i, absPreheatFanSpeed);
|
205
|
212
|
|
206
|
|
- for (int e = 0; e < 4; e++) {
|
|
213
|
+ for (uint8_t e = 0; e < 4; e++) {
|
207
|
214
|
|
208
|
215
|
#if ENABLED(PIDTEMP)
|
209
|
216
|
if (e < EXTRUDERS) {
|
|
@@ -223,7 +230,7 @@ void Config_StoreSettings() {
|
223
|
230
|
dummy = DUMMY_PID_VALUE; // When read, will not change the existing value
|
224
|
231
|
EEPROM_WRITE_VAR(i, dummy);
|
225
|
232
|
dummy = 0.0f;
|
226
|
|
- for (int q = 3; q--;) EEPROM_WRITE_VAR(i, dummy);
|
|
233
|
+ for (uint8_t q = 3; q--;) EEPROM_WRITE_VAR(i, dummy);
|
227
|
234
|
}
|
228
|
235
|
|
229
|
236
|
} // Extruders Loop
|
|
@@ -277,7 +284,7 @@ void Config_StoreSettings() {
|
277
|
284
|
EEPROM_WRITE_VAR(i, volumetric_enabled);
|
278
|
285
|
|
279
|
286
|
// Save filament sizes
|
280
|
|
- for (int q = 0; q < 4; q++) {
|
|
287
|
+ for (uint8_t q = 0; q < 4; q++) {
|
281
|
288
|
if (q < EXTRUDERS) dummy = filament_size[q];
|
282
|
289
|
EEPROM_WRITE_VAR(i, dummy);
|
283
|
290
|
}
|
|
@@ -339,10 +346,10 @@ void Config_RetrieveSettings() {
|
339
|
346
|
EEPROM_READ_VAR(i, mbl.z_values);
|
340
|
347
|
} else {
|
341
|
348
|
mbl.reset();
|
342
|
|
- for (int q = 0; q < mesh_num_x * mesh_num_y; q++) EEPROM_READ_VAR(i, dummy);
|
|
349
|
+ for (uint8_t q = 0; q < mesh_num_x * mesh_num_y; q++) EEPROM_READ_VAR(i, dummy);
|
343
|
350
|
}
|
344
|
351
|
#else
|
345
|
|
- for (int q = 0; q < mesh_num_x * mesh_num_y; q++) EEPROM_READ_VAR(i, dummy);
|
|
352
|
+ for (uint8_t q = 0; q < mesh_num_x * mesh_num_y; q++) EEPROM_READ_VAR(i, dummy);
|
346
|
353
|
#endif // MESH_BED_LEVELING
|
347
|
354
|
|
348
|
355
|
#if DISABLED(AUTO_BED_LEVELING_FEATURE)
|
|
@@ -358,10 +365,10 @@ void Config_RetrieveSettings() {
|
358
|
365
|
#elif ENABLED(Z_DUAL_ENDSTOPS)
|
359
|
366
|
EEPROM_READ_VAR(i, z_endstop_adj);
|
360
|
367
|
dummy = 0.0f;
|
361
|
|
- for (int q=5; q--;) EEPROM_READ_VAR(i, dummy);
|
|
368
|
+ for (uint8_t q=5; q--;) EEPROM_READ_VAR(i, dummy);
|
362
|
369
|
#else
|
363
|
370
|
dummy = 0.0f;
|
364
|
|
- for (int q=6; q--;) EEPROM_READ_VAR(i, dummy);
|
|
371
|
+ for (uint8_t q=6; q--;) EEPROM_READ_VAR(i, dummy);
|
365
|
372
|
#endif
|
366
|
373
|
|
367
|
374
|
#if DISABLED(ULTIPANEL)
|
|
@@ -377,7 +384,7 @@ void Config_RetrieveSettings() {
|
377
|
384
|
EEPROM_READ_VAR(i, absPreheatFanSpeed);
|
378
|
385
|
|
379
|
386
|
#if ENABLED(PIDTEMP)
|
380
|
|
- for (int e = 0; e < 4; e++) { // 4 = max extruders currently supported by Marlin
|
|
387
|
+ for (uint8_t e = 0; e < 4; e++) { // 4 = max extruders currently supported by Marlin
|
381
|
388
|
EEPROM_READ_VAR(i, dummy); // Kp
|
382
|
389
|
if (e < EXTRUDERS && dummy != DUMMY_PID_VALUE) {
|
383
|
390
|
// do not need to scale PID values as the values in EEPROM are already scaled
|
|
@@ -391,12 +398,12 @@ void Config_RetrieveSettings() {
|
391
|
398
|
#endif
|
392
|
399
|
}
|
393
|
400
|
else {
|
394
|
|
- for (int q=3; q--;) EEPROM_READ_VAR(i, dummy); // Ki, Kd, Kc
|
|
401
|
+ for (uint8_t q=3; q--;) EEPROM_READ_VAR(i, dummy); // Ki, Kd, Kc
|
395
|
402
|
}
|
396
|
403
|
}
|
397
|
404
|
#else // !PIDTEMP
|
398
|
405
|
// 4 x 4 = 16 slots for PID parameters
|
399
|
|
- for (int q=16; q--;) EEPROM_READ_VAR(i, dummy); // 4x Kp, Ki, Kd, Kc
|
|
406
|
+ for (uint8_t q=16; q--;) EEPROM_READ_VAR(i, dummy); // 4x Kp, Ki, Kd, Kc
|
400
|
407
|
#endif // !PIDTEMP
|
401
|
408
|
|
402
|
409
|
#if DISABLED(PID_ADD_EXTRUSION_RATE)
|
|
@@ -415,7 +422,7 @@ void Config_RetrieveSettings() {
|
415
|
422
|
EEPROM_READ_VAR(i, bedKd);
|
416
|
423
|
}
|
417
|
424
|
else {
|
418
|
|
- for (int q=2; q--;) EEPROM_READ_VAR(i, dummy); // bedKi, bedKd
|
|
425
|
+ for (uint8_t q=2; q--;) EEPROM_READ_VAR(i, dummy); // bedKi, bedKd
|
419
|
426
|
}
|
420
|
427
|
|
421
|
428
|
#if DISABLED(HAS_LCD_CONTRAST)
|
|
@@ -450,7 +457,7 @@ void Config_RetrieveSettings() {
|
450
|
457
|
|
451
|
458
|
EEPROM_READ_VAR(i, volumetric_enabled);
|
452
|
459
|
|
453
|
|
- for (int q = 0; q < 4; q++) {
|
|
460
|
+ for (uint8_t q = 0; q < 4; q++) {
|
454
|
461
|
EEPROM_READ_VAR(i, dummy);
|
455
|
462
|
if (q < EXTRUDERS) filament_size[q] = dummy;
|
456
|
463
|
}
|
|
@@ -538,7 +545,7 @@ void Config_ResetDefault() {
|
538
|
545
|
|
539
|
546
|
#if ENABLED(PIDTEMP)
|
540
|
547
|
#if ENABLED(PID_PARAMS_PER_EXTRUDER)
|
541
|
|
- for (int e = 0; e < EXTRUDERS; e++)
|
|
548
|
+ for (uint8_t e = 0; e < EXTRUDERS; e++)
|
542
|
549
|
#else
|
543
|
550
|
int e = 0; UNUSED(e); // only need to write once
|
544
|
551
|
#endif
|
|
@@ -686,8 +693,8 @@ void Config_PrintSettings(bool forReplay) {
|
686
|
693
|
SERIAL_ECHOPAIR(" X", (unsigned long)MESH_NUM_X_POINTS);
|
687
|
694
|
SERIAL_ECHOPAIR(" Y", (unsigned long)MESH_NUM_Y_POINTS);
|
688
|
695
|
SERIAL_EOL;
|
689
|
|
- for (int y = 0; y < MESH_NUM_Y_POINTS; y++) {
|
690
|
|
- for (int x = 0; x < MESH_NUM_X_POINTS; x++) {
|
|
696
|
+ for (uint8_t y = 0; y < MESH_NUM_Y_POINTS; y++) {
|
|
697
|
+ for (uint8_t x = 0; x < MESH_NUM_X_POINTS; x++) {
|
691
|
698
|
CONFIG_ECHO_START;
|
692
|
699
|
SERIAL_ECHOPAIR(" M421 X", mbl.get_x(x));
|
693
|
700
|
SERIAL_ECHOPAIR(" Y", mbl.get_y(y));
|
|
@@ -708,8 +715,10 @@ void Config_PrintSettings(bool forReplay) {
|
708
|
715
|
SERIAL_ECHOPAIR(" Z", endstop_adj[Z_AXIS]);
|
709
|
716
|
SERIAL_EOL;
|
710
|
717
|
CONFIG_ECHO_START;
|
711
|
|
- SERIAL_ECHOLNPGM("Delta settings: L=delta_diagonal_rod, R=delta_radius, S=delta_segments_per_second");
|
712
|
|
- CONFIG_ECHO_START;
|
|
718
|
+ if (!forReplay) {
|
|
719
|
+ SERIAL_ECHOLNPGM("Delta settings: L=delta_diagonal_rod, R=delta_radius, S=delta_segments_per_second");
|
|
720
|
+ CONFIG_ECHO_START;
|
|
721
|
+ }
|
713
|
722
|
SERIAL_ECHOPAIR(" M665 L", delta_diagonal_rod);
|
714
|
723
|
SERIAL_ECHOPAIR(" R", delta_radius);
|
715
|
724
|
SERIAL_ECHOPAIR(" S", delta_segments_per_second);
|