소스 검색

Allow TMC2209 to save/restore spreadCycle (#16153)

Co-Authored-By: teemuatlut <teemu.mantykallio@live.fi>
elementfoundry 4 년 전
부모
커밋
e5edbf9d35
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3
    2
      Marlin/src/feature/tmc_util.cpp

+ 3
- 2
Marlin/src/feature/tmc_util.cpp 파일 보기

@@ -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
 

Loading…
취소
저장