Skip to content

Commit

Permalink
Fix EEPROM error when EXTRUDERS == 0
Browse files Browse the repository at this point in the history
When EXTRUDERS == 0, saving does nothing, but loading loads a zero-length array which evidently is not the same as skipping the operation entirely
  • Loading branch information
vector76 authored and thinkyhead committed Jan 5, 2020
1 parent cc21466 commit f2b54c1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Marlin/src/module/configuration_store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1934,12 +1934,14 @@ void MarlinSettings::postprocess() {
// Linear Advance
//
{
float extruder_advance_K[EXTRUDERS];
_FIELD_TEST(planner_extruder_advance_K);
EEPROM_READ(extruder_advance_K);
#if ENABLED(LIN_ADVANCE)
if (!validating)
COPY(planner.extruder_advance_K, extruder_advance_K);
#if EXTRUDERS
float extruder_advance_K[EXTRUDERS];
EEPROM_READ(extruder_advance_K);
#if ENABLED(LIN_ADVANCE)
if (!validating)
COPY(planner.extruder_advance_K, extruder_advance_K);
#endif
#endif
}

Expand Down

0 comments on commit f2b54c1

Please sign in to comment.