|
@@ -40,6 +40,7 @@
|
40
|
40
|
|
41
|
41
|
// Change EEPROM version if these are changed:
|
42
|
42
|
#define EEPROM_OFFSET 100
|
|
43
|
+#define MAX_EXTRUDERS 4
|
43
|
44
|
|
44
|
45
|
/**
|
45
|
46
|
* V24 EEPROM Layout:
|
|
@@ -270,7 +271,7 @@ void Config_StoreSettings() {
|
270
|
271
|
EEPROM_WRITE_VAR(i, absPreheatHPBTemp);
|
271
|
272
|
EEPROM_WRITE_VAR(i, absPreheatFanSpeed);
|
272
|
273
|
|
273
|
|
- for (uint8_t e = 0; e < 4; e++) {
|
|
274
|
+ for (uint8_t e = 0; e < MAX_EXTRUDERS; e++) {
|
274
|
275
|
|
275
|
276
|
#if ENABLED(PIDTEMP)
|
276
|
277
|
if (e < HOTENDS) {
|
|
@@ -345,7 +346,7 @@ void Config_StoreSettings() {
|
345
|
346
|
EEPROM_WRITE_VAR(i, volumetric_enabled);
|
346
|
347
|
|
347
|
348
|
// Save filament sizes
|
348
|
|
- for (uint8_t q = 0; q < 4; q++) {
|
|
349
|
+ for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) {
|
349
|
350
|
if (q < EXTRUDERS) dummy = filament_size[q];
|
350
|
351
|
EEPROM_WRITE_VAR(i, dummy);
|
351
|
352
|
}
|
|
@@ -452,7 +453,7 @@ void Config_RetrieveSettings() {
|
452
|
453
|
EEPROM_READ_VAR(i, absPreheatFanSpeed);
|
453
|
454
|
|
454
|
455
|
#if ENABLED(PIDTEMP)
|
455
|
|
- for (uint8_t e = 0; e < 4; e++) { // 4 = max extruders currently supported by Marlin
|
|
456
|
+ for (uint8_t e = 0; e < MAX_EXTRUDERS; e++) {
|
456
|
457
|
EEPROM_READ_VAR(i, dummy); // Kp
|
457
|
458
|
if (e < HOTENDS && dummy != DUMMY_PID_VALUE) {
|
458
|
459
|
// do not need to scale PID values as the values in EEPROM are already scaled
|
|
@@ -471,7 +472,7 @@ void Config_RetrieveSettings() {
|
471
|
472
|
}
|
472
|
473
|
#else // !PIDTEMP
|
473
|
474
|
// 4 x 4 = 16 slots for PID parameters
|
474
|
|
- for (uint8_t q=16; q--;) EEPROM_READ_VAR(i, dummy); // 4x Kp, Ki, Kd, Kc
|
|
475
|
+ for (uint8_t q = MAX_EXTRUDERS * 4; q--;) EEPROM_READ_VAR(i, dummy); // Kp, Ki, Kd, Kc
|
475
|
476
|
#endif // !PIDTEMP
|
476
|
477
|
|
477
|
478
|
#if DISABLED(PID_ADD_EXTRUSION_RATE)
|
|
@@ -522,7 +523,7 @@ void Config_RetrieveSettings() {
|
522
|
523
|
|
523
|
524
|
EEPROM_READ_VAR(i, volumetric_enabled);
|
524
|
525
|
|
525
|
|
- for (uint8_t q = 0; q < 4; q++) {
|
|
526
|
+ for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) {
|
526
|
527
|
EEPROM_READ_VAR(i, dummy);
|
527
|
528
|
if (q < EXTRUDERS) filament_size[q] = dummy;
|
528
|
529
|
}
|