From 8eb32cef2433e8cbbc4b89a27eff27886cb7b95c Mon Sep 17 00:00:00 2001 From: devin122 Date: Mon, 11 Jan 2021 02:46:17 -0500 Subject: [PATCH] Fix TMC220x short circuit (#20731) --- Marlin/src/feature/tmc_util.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/feature/tmc_util.cpp b/Marlin/src/feature/tmc_util.cpp index d27177326..29bb249ce 100644 --- a/Marlin/src/feature/tmc_util.cpp +++ b/Marlin/src/feature/tmc_util.cpp @@ -147,7 +147,7 @@ static TMC_driver_data get_driver_data(TMC2208Stepper &st) { constexpr uint8_t OTPW_bp = 0, OT_bp = 1; - constexpr uint8_t S2G_bm = 0b11110; // 2..5 + constexpr uint8_t S2G_bm = 0b111100; // 2..5 TMC_driver_data data; const auto ds = data.drv_status = st.DRV_STATUS(); data.is_otpw = TEST(ds, OTPW_bp); @@ -291,7 +291,7 @@ bool should_step_down = false; if (need_update_error_counters) { - if (data.is_ot /* | data.s2ga | data.s2gb*/) st.error_count++; + if (data.is_ot | data.is_s2g) st.error_count++; else if (st.error_count > 0) st.error_count--; #if ENABLED(STOP_ON_ERROR)