From d332fcb8fa34d7012b08f4f06f8354cca64d0fb4 Mon Sep 17 00:00:00 2001 From: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Wed, 10 Oct 2018 17:46:08 -0400 Subject: [PATCH] Fix firmware-retract compile errors (#12061) --- Marlin/src/feature/fwretract.cpp | 4 +++- Marlin/src/module/configuration_store.cpp | 13 ++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Marlin/src/feature/fwretract.cpp b/Marlin/src/feature/fwretract.cpp index c48f4ef9cc..7cb29a970b 100644 --- a/Marlin/src/feature/fwretract.cpp +++ b/Marlin/src/feature/fwretract.cpp @@ -60,7 +60,9 @@ float FWRetract::current_retract[EXTRUDERS], // Retract value used by p FWRetract::current_hop; void FWRetract::reset() { - autoretract_enabled = false; + #if ENABLED(FWRETRACT_AUTORETRACT) + autoretract_enabled = false; + #endif settings.retract_length = RETRACT_LENGTH; settings.retract_feedrate_mm_s = RETRACT_FEEDRATE; settings.retract_zlift = RETRACT_ZLIFT; diff --git a/Marlin/src/module/configuration_store.cpp b/Marlin/src/module/configuration_store.cpp index f5c63a321e..3d4a1e42e4 100644 --- a/Marlin/src/module/configuration_store.cpp +++ b/Marlin/src/module/configuration_store.cpp @@ -697,11 +697,14 @@ void MarlinSettings::postprocess() { #if ENABLED(FWRETRACT) EEPROM_WRITE(fwretract.settings); - EEPROM_WRITE(fwretract.autoretract_enabled); #else const fwretract_settings_t autoretract_defaults = { 3, 45, 0, 0, 0, 13, 0, 8 }; - const bool autoretract_enabled = false; EEPROM_WRITE(autoretract_defaults); + #endif + #if ENABLED(FWRETRACT) && ENABLED(FWRETRACT_AUTORETRACT) + EEPROM_WRITE(fwretract.autoretract_enabled); + #else + const bool autoretract_enabled = false; EEPROM_WRITE(autoretract_enabled); #endif } @@ -1311,11 +1314,11 @@ void MarlinSettings::postprocess() { #if ENABLED(FWRETRACT) EEPROM_READ(fwretract.settings); + #endif + #if ENABLED(FWRETRACT) && ENABLED(FWRETRACT_AUTORETRACT) EEPROM_READ(fwretract.autoretract_enabled); #else - fwretract_settings_t fwretract_settings; bool autoretract_enabled; - EEPROM_READ(fwretract_settings); EEPROM_READ(autoretract_enabled); #endif } @@ -1575,7 +1578,7 @@ void MarlinSettings::postprocess() { _FIELD_TEST(sn_settings); EEPROM_READ(sn_settings); #endif - + eeprom_error = size_error(eeprom_index - (EEPROM_OFFSET)); if (eeprom_error) { #if ENABLED(EEPROM_CHITCHAT)