Browse Source

Fix EEPROM error with EXTRUDERS == 0 (#16464)

Jamie 4 years ago
parent
commit
fc07b0ea30
1 changed files with 5 additions and 5 deletions
  1. 5
    5
      Marlin/src/module/configuration_store.cpp

+ 5
- 5
Marlin/src/module/configuration_store.cpp View File

@@ -1145,7 +1145,7 @@ void MarlinSettings::postprocess() {
1145 1145
         EEPROM_WRITE(planner.extruder_advance_K);
1146 1146
       #else
1147 1147
         dummy = 0;
1148
-        for (uint8_t q = EXTRUDERS; q--;) EEPROM_WRITE(dummy);
1148
+        for (uint8_t q = MIN(EXTRUDERS, 1); q--;) EEPROM_WRITE(dummy);
1149 1149
       #endif
1150 1150
     }
1151 1151
 
@@ -1934,7 +1934,7 @@ void MarlinSettings::postprocess() {
1934 1934
       // Linear Advance
1935 1935
       //
1936 1936
       {
1937
-        float extruder_advance_K[EXTRUDERS];
1937
+        float extruder_advance_K[MIN(EXTRUDERS, 1)];
1938 1938
         _FIELD_TEST(planner_extruder_advance_K);
1939 1939
         EEPROM_READ(extruder_advance_K);
1940 1940
         #if ENABLED(LIN_ADVANCE)
@@ -2554,9 +2554,9 @@ void MarlinSettings::reset() {
2554 2554
   #if ENABLED(LIN_ADVANCE)
2555 2555
     LOOP_L_N(i, EXTRUDERS) {
2556 2556
       planner.extruder_advance_K[i] = LIN_ADVANCE_K;
2557
-    #if ENABLED(EXTRA_LIN_ADVANCE_K)
2558
-      saved_extruder_advance_K[i] = LIN_ADVANCE_K;
2559
-    #endif
2557
+      #if ENABLED(EXTRA_LIN_ADVANCE_K)
2558
+        saved_extruder_advance_K[i] = LIN_ADVANCE_K;
2559
+      #endif
2560 2560
     }
2561 2561
   #endif
2562 2562
 

Loading…
Cancel
Save