From a7e5c1bf19cdfeea1333b9d4d5df13b1cc52ad52 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 5 Aug 2017 02:33:20 -0500 Subject: [PATCH] Use float to init TMC2133 steps-per-mm --- Marlin/stepper_indirection.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/stepper_indirection.cpp b/Marlin/stepper_indirection.cpp index c2f302704..9e9d3bf99 100644 --- a/Marlin/stepper_indirection.cpp +++ b/Marlin/stepper_indirection.cpp @@ -171,7 +171,7 @@ // Use internal reference voltage for current calculations. This is the default. // Following values from Trinamic's spreadsheet with values for a NEMA17 (42BYGHW609) // https://www.trinamic.com/products/integrated-circuits/details/tmc2130/ - void tmc2130_init(TMC2130Stepper &st, const uint16_t microsteps, const uint32_t thrs, const uint32_t spmm) { + void tmc2130_init(TMC2130Stepper &st, const uint16_t microsteps, const uint32_t thrs, const float &spmm) { st.begin(); st.setCurrent(st.getCurrent(), R_SENSE, HOLD_MULTIPLIER); st.microsteps(microsteps); @@ -199,7 +199,7 @@ #define _TMC2130_INIT(ST, SPMM) tmc2130_init(stepper##ST, ST##_MICROSTEPS, ST##_HYBRID_THRESHOLD, SPMM) void tmc2130_init() { - constexpr uint16_t steps_per_mm[] = DEFAULT_AXIS_STEPS_PER_UNIT; + constexpr float steps_per_mm[] = DEFAULT_AXIS_STEPS_PER_UNIT; #if ENABLED(X_IS_TMC2130) _TMC2130_INIT( X, steps_per_mm[X_AXIS]); #if ENABLED(SENSORLESS_HOMING)