Quellcode durchsuchen

Followup to TMC2209 spreadcycle patch

Scott Lahteine vor 4 Jahren
Ursprung
Commit
937dca4432
1 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 2
    2
      Marlin/src/feature/tmc_util.cpp

+ 2
- 2
Marlin/src/feature/tmc_util.cpp Datei anzeigen

1022
 #if USE_SENSORLESS
1022
 #if USE_SENSORLESS
1023
 
1023
 
1024
   bool tmc_enable_stallguard(TMC2130Stepper &st) {
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
     st.TCOOLTHRS(0xFFFFF);
1027
     st.TCOOLTHRS(0xFFFFF);
1028
     st.en_pwm_mode(false);
1028
     st.en_pwm_mode(false);
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 stealthchop_was_enabled;
1041
+    return !st.en_spreadCycle();
1042
   }
1042
   }
1043
   void tmc_disable_stallguard(TMC2209Stepper &st, const bool restore_stealth) {
1043
   void tmc_disable_stallguard(TMC2209Stepper &st, const bool restore_stealth) {
1044
     st.en_spreadCycle(!restore_stealth);
1044
     st.en_spreadCycle(!restore_stealth);

Laden…
Abbrechen
Speichern