Ver código fonte

Allow TMC2209 to save/restore spreadCycle (#16153)

Co-Authored-By: teemuatlut <teemu.mantykallio@live.fi>
elementfoundry 4 anos atrás
pai
commit
e5edbf9d35
1 arquivos alterados com 3 adições e 2 exclusões
  1. 3
    2
      Marlin/src/feature/tmc_util.cpp

+ 3
- 2
Marlin/src/feature/tmc_util.cpp Ver arquivo

@@ -1038,9 +1038,10 @@
1038 1038
 
1039 1039
   bool tmc_enable_stallguard(TMC2209Stepper &st) {
1040 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 1045
     st.TCOOLTHRS(0);
1045 1046
   }
1046 1047
 

Carregando…
Cancelar
Salvar