Allow TMC2209 to save/restore spreadCycle (#16153)
Co-Authored-By: teemuatlut <teemu.mantykallio@live.fi>
This commit is contained in:
parent
865071a946
commit
e5edbf9d35
1 changed files with 3 additions and 2 deletions
|
@ -1038,9 +1038,10 @@
|
||||||
|
|
||||||
bool tmc_enable_stallguard(TMC2209Stepper &st) {
|
bool tmc_enable_stallguard(TMC2209Stepper &st) {
|
||||||
st.TCOOLTHRS(0xFFFFF);
|
st.TCOOLTHRS(0xFFFFF);
|
||||||
return true;
|
return stealthchop_was_enabled;
|
||||||
}
|
}
|
||||||
void tmc_disable_stallguard(TMC2209Stepper &st, const bool restore_stealth _UNUSED) {
|
void tmc_disable_stallguard(TMC2209Stepper &st, const bool restore_stealth) {
|
||||||
|
st.en_spreadCycle(!restore_stealth);
|
||||||
st.TCOOLTHRS(0);
|
st.TCOOLTHRS(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue