More Trinamic cleanup

This commit is contained in:
Scott Lahteine
2018-05-09 23:42:40 -05:00
parent 8e818ade5e
commit 42de5b0310
4 changed files with 73 additions and 50 deletions
+4 -3
View File
@@ -179,6 +179,10 @@
// 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 mA, const uint16_t microsteps, const uint32_t thrs, const float spmm) {
#if DISABLED(STEALTHCHOP) || DISABLED(HYBRID_THRESHOLD)
UNUSED(thrs);
UNUSED(spmm);
#endif
st.begin();
st.setCurrent(mA, R_SENSE, HOLD_MULTIPLIER);
st.microsteps(microsteps);
@@ -196,9 +200,6 @@
st.stealthChop(1);
#if ENABLED(HYBRID_THRESHOLD)
st.stealth_max_speed(12650000UL*microsteps/(256*thrs*spmm));
#else
UNUSED(thrs);
UNUSED(spmm);
#endif
#elif ENABLED(SENSORLESS_HOMING)
st.coolstep_min_speed(1024UL * 1024UL - 1UL);