Browse Source

Allow TMC2209 to save/restore spreadCycle (#16153)

Co-Authored-By: teemuatlut <teemu.mantykallio@live.fi>
elementfoundry 5 years ago
parent
commit
e5edbf9d35
1 changed files with 3 additions and 2 deletions
  1. 3
    2
      Marlin/src/feature/tmc_util.cpp

+ 3
- 2
Marlin/src/feature/tmc_util.cpp View File

1038
 
1038
 
1039
   bool tmc_enable_stallguard(TMC2209Stepper &st) {
1039
   bool tmc_enable_stallguard(TMC2209Stepper &st) {
1040
     st.TCOOLTHRS(0xFFFFF);
1040
     st.TCOOLTHRS(0xFFFFF);
1041
-    return true;
1041
+    return stealthchop_was_enabled;
1042
   }
1042
   }
1043
-  void tmc_disable_stallguard(TMC2209Stepper &st, const bool restore_stealth _UNUSED) {
1043
+  void tmc_disable_stallguard(TMC2209Stepper &st, const bool restore_stealth) {
1044
+    st.en_spreadCycle(!restore_stealth);
1044
     st.TCOOLTHRS(0);
1045
     st.TCOOLTHRS(0);
1045
   }
1046
   }
1046
 
1047
 

Loading…
Cancel
Save