Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix EEPROM error when EXTRUDERS == 0 #16464

Merged
merged 2 commits into from
Jan 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Marlin/src/module/configuration_store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1145,7 +1145,7 @@ void MarlinSettings::postprocess() {
EEPROM_WRITE(planner.extruder_advance_K);
#else
dummy = 0;
for (uint8_t q = EXTRUDERS; q--;) EEPROM_WRITE(dummy);
for (uint8_t q = MIN(EXTRUDERS, 1); q--;) EEPROM_WRITE(dummy);
#endif
}

Expand Down Expand Up @@ -1934,7 +1934,7 @@ void MarlinSettings::postprocess() {
// Linear Advance
//
{
float extruder_advance_K[EXTRUDERS];
float extruder_advance_K[MIN(EXTRUDERS, 1)];
_FIELD_TEST(planner_extruder_advance_K);
EEPROM_READ(extruder_advance_K);
#if ENABLED(LIN_ADVANCE)
Expand Down Expand Up @@ -2554,9 +2554,9 @@ void MarlinSettings::reset() {
#if ENABLED(LIN_ADVANCE)
LOOP_L_N(i, EXTRUDERS) {
planner.extruder_advance_K[i] = LIN_ADVANCE_K;
#if ENABLED(EXTRA_LIN_ADVANCE_K)
saved_extruder_advance_K[i] = LIN_ADVANCE_K;
#endif
#if ENABLED(EXTRA_LIN_ADVANCE_K)
saved_extruder_advance_K[i] = LIN_ADVANCE_K;
#endif
}
#endif

Expand Down