From f30897500d37b59fbf975cfc772c4359fe8b2566 Mon Sep 17 00:00:00 2001 From: Karl Andersson Date: Fri, 21 Feb 2020 14:40:55 +0100 Subject: [PATCH] Disable spreadcycle in tmc_enable_stallguard<2209> (#16890) --- Marlin/src/feature/tmc_util.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Marlin/src/feature/tmc_util.cpp b/Marlin/src/feature/tmc_util.cpp index be26b804b5..9f905021ea 100644 --- a/Marlin/src/feature/tmc_util.cpp +++ b/Marlin/src/feature/tmc_util.cpp @@ -1096,8 +1096,11 @@ } bool tmc_enable_stallguard(TMC2209Stepper &st) { + const bool stealthchop_was_enabled = !st.en_spreadCycle(); + st.TCOOLTHRS(0xFFFFF); - return !st.en_spreadCycle(); + st.en_spreadCycle(false); + return stealthchop_was_enabled; } void tmc_disable_stallguard(TMC2209Stepper &st, const bool restore_stealth) { st.en_spreadCycle(!restore_stealth);