From 0d342bac51a5f32d143f0dba9c65af820dfab621 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 1 Feb 2020 06:27:17 -0600 Subject: [PATCH] Fix CURRENT_STEP_DOWN compile error --- Marlin/src/feature/tmc_util.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Marlin/src/feature/tmc_util.cpp b/Marlin/src/feature/tmc_util.cpp index 340855a6da..84b5c2db7b 100644 --- a/Marlin/src/feature/tmc_util.cpp +++ b/Marlin/src/feature/tmc_util.cpp @@ -281,6 +281,10 @@ } } + #else + + #define step_current_down(...) + #endif template @@ -288,7 +292,7 @@ TMC_driver_data data = get_driver_data(st); if (data.drv_status == 0xFFFFFFFF || data.drv_status == 0x0) return false; - bool did_step_down = false; + bool should_step_down = false; if (need_update_error_counters) { if (data.is_ot /* | data.s2ga | data.s2gb*/) st.error_count++; @@ -308,10 +312,8 @@ #if CURRENT_STEP_DOWN > 0 // Decrease current if is_otpw is true and driver is enabled and there's been more than 4 warnings - if (data.is_otpw && st.otpw_count > 4 && st.isEnabled()) { - step_current_down(st); - did_step_down = true; - } + if (data.is_otpw && st.otpw_count > 4 && st.isEnabled()) + should_step_down = true; #endif if (data.is_otpw) { @@ -325,7 +327,7 @@ if (need_debug_reporting) report_polled_driver_data(st, data); #endif - return did_step_down; + return should_step_down; } void monitor_tmc_drivers() {