浏览代码

Followup to TMC2209 spreadcycle patch

Scott Lahteine 4 年前
父节点
当前提交
937dca4432
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2
    2
      Marlin/src/feature/tmc_util.cpp

+ 2
- 2
Marlin/src/feature/tmc_util.cpp 查看文件

@@ -1022,7 +1022,7 @@
1022 1022
 #if USE_SENSORLESS
1023 1023
 
1024 1024
   bool tmc_enable_stallguard(TMC2130Stepper &st) {
1025
-    bool stealthchop_was_enabled = st.en_pwm_mode();
1025
+    const bool stealthchop_was_enabled = st.en_pwm_mode();
1026 1026
 
1027 1027
     st.TCOOLTHRS(0xFFFFF);
1028 1028
     st.en_pwm_mode(false);
@@ -1038,7 +1038,7 @@
1038 1038
 
1039 1039
   bool tmc_enable_stallguard(TMC2209Stepper &st) {
1040 1040
     st.TCOOLTHRS(0xFFFFF);
1041
-    return stealthchop_was_enabled;
1041
+    return !st.en_spreadCycle();
1042 1042
   }
1043 1043
   void tmc_disable_stallguard(TMC2209Stepper &st, const bool restore_stealth) {
1044 1044
     st.en_spreadCycle(!restore_stealth);

正在加载...
取消
保存