From e7a61de8afb20718875cd4afd3ae605e51499a77 Mon Sep 17 00:00:00 2001 From: Studiodyne Date: Wed, 14 Mar 2018 07:35:30 +0100 Subject: [PATCH] [2.0] FWRetract Reset (Best way) (#10083) --- Marlin/Configuration_adv.h | 2 +- Marlin/src/feature/fwretract.cpp | 4 +++- Marlin/src/feature/fwretract.h | 3 ++- Marlin/src/module/motion.cpp | 4 ++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index be73997b4..7ba3f6b1d 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -863,7 +863,7 @@ * will be converted to firmware-based retract/recover moves. * * Note: Be sure to turn off auto-retract during filament change. - * Note: Current status (Retract / Swap / Zlift) isn't reset by G28. + * Note: Current Zlift reset by G28 or G28 Z. * * Note that M207 / M208 / M209 settings are saved to EEPROM. * diff --git a/Marlin/src/feature/fwretract.cpp b/Marlin/src/feature/fwretract.cpp index 8d7b570e6..3c7526084 100644 --- a/Marlin/src/feature/fwretract.cpp +++ b/Marlin/src/feature/fwretract.cpp @@ -53,7 +53,8 @@ float FWRetract::retract_length, // M207 S - G10 Retract len FWRetract::retract_recover_feedrate_mm_s, // M208 F - G11 Recover feedrate FWRetract::swap_retract_length, // M207 W - G10 Swap Retract length FWRetract::swap_retract_recover_length, // M208 W - G11 Swap Recover length - FWRetract::swap_retract_recover_feedrate_mm_s; // M208 R - G11 Swap Recover feedrate + FWRetract::swap_retract_recover_feedrate_mm_s, // M208 R - G11 Swap Recover feedrate + FWRetract::hop_amount; void FWRetract::reset() { autoretract_enabled = false; @@ -65,6 +66,7 @@ void FWRetract::reset() { swap_retract_length = RETRACT_LENGTH_SWAP; swap_retract_recover_length = RETRACT_RECOVER_LENGTH_SWAP; swap_retract_recover_feedrate_mm_s = RETRACT_RECOVER_FEEDRATE_SWAP; + hop_amount = 0.0; for (uint8_t i = 0; i < EXTRUDERS; ++i) { retracted[i] = false; diff --git a/Marlin/src/feature/fwretract.h b/Marlin/src/feature/fwretract.h index 00e4da635..bb086df83 100644 --- a/Marlin/src/feature/fwretract.h +++ b/Marlin/src/feature/fwretract.h @@ -45,7 +45,8 @@ public: retract_recover_feedrate_mm_s, // M208 F - G11 Recover feedrate swap_retract_length, // M207 W - G10 Swap Retract length swap_retract_recover_length, // M208 W - G11 Swap Recover length - swap_retract_recover_feedrate_mm_s; // M208 R - G11 Swap Recover feedrate + swap_retract_recover_feedrate_mm_s, // M208 R - G11 Swap Recover feedrate + hop_amount; FWRetract() { reset(); } diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 446fd08f9..f3ec0dfe7 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -1305,10 +1305,10 @@ void homeaxis(const AxisEnum axis) { if (axis == Z_AXIS && STOW_PROBE()) return; #endif - // Clear retracted status if homing the Z axis + // Clear z_lift if homing the Z axis #if ENABLED(FWRETRACT) if (axis == Z_AXIS) - for (uint8_t i = 0; i < EXTRUDERS; i++) fwretract.retracted[i] = false; + fwretract.hop_amount = 0.0; #endif #if ENABLED(DEBUG_LEVELING_FEATURE)