Selaa lähdekoodia

Fix TMC-related compile issues. (#12971)

- `STEALTHOP_[XYZE]` configuration options now set the default state.
teemuatlut 6 vuotta sitten
vanhempi
commit
e5801b75f8

+ 2
- 6
Marlin/src/feature/tmc_util.cpp Näytä tiedosto

@@ -838,18 +838,14 @@
838 838
     bool stealthchop_was_enabled = st.en_pwm_mode();
839 839
 
840 840
     st.TCOOLTHRS(0xFFFFF);
841
-    #if STEALTHCHOP_ENABLED
842
-      st.en_pwm_mode(false);
843
-    #endif
841
+    st.en_pwm_mode(false);
844 842
     st.diag1_stall(true);
845 843
 
846 844
     return stealthchop_was_enabled;
847 845
   }
848 846
   void tmc_disable_stallguard(TMC2130Stepper &st, const bool restore_stealth) {
849 847
     st.TCOOLTHRS(0);
850
-    #if STEALTHCHOP_ENABLED
851
-      st.en_pwm_mode(restore_stealth);
852
-    #endif
848
+    st.en_pwm_mode(restore_stealth);
853 849
     st.diag1_stall(false);
854 850
   }
855 851
   bool tmc_enable_stallguard(TMC2660Stepper) {

+ 3
- 6
Marlin/src/feature/tmc_util.h Näytä tiedosto

@@ -82,7 +82,7 @@ class TMCStorage {
82 82
     }
83 83
 
84 84
     struct {
85
-      #if STEALTHCHOP_ENABLED
85
+      #if HAS_STEALTHCHOP
86 86
         bool stealthChop_enabled = false;
87 87
       #endif
88 88
       #if ENABLED(HYBRID_THRESHOLD)
@@ -113,7 +113,7 @@ class TMCMarlin : public TMC, public TMCStorage<AXIS_LETTER, DRIVER_ID> {
113 113
       TMC::rms_current(mA, mult);
114 114
     }
115 115
 
116
-    #if STEALTHCHOP_ENABLED
116
+    #if HAS_STEALTHCHOP
117 117
       inline void refresh_stepping_mode() { this->en_pwm_mode(this->stored.stealthChop_enabled); }
118 118
       inline bool get_stealthChop_status() { return this->en_pwm_mode(); }
119 119
     #endif
@@ -158,7 +158,7 @@ class TMCMarlin<TMC2208Stepper, AXIS_LETTER, DRIVER_ID> : public TMC2208Stepper,
158 158
       TMC2208Stepper::rms_current(mA, mult);
159 159
     }
160 160
 
161
-    #if STEALTHCHOP_ENABLED
161
+    #if HAS_STEALTHCHOP
162 162
       inline void refresh_stepping_mode() { en_spreadCycle(!this->stored.stealthChop_enabled); }
163 163
       inline bool get_stealthChop_status() { return !this->en_spreadCycle(); }
164 164
     #endif
@@ -169,9 +169,6 @@ class TMCMarlin<TMC2208Stepper, AXIS_LETTER, DRIVER_ID> : public TMC2208Stepper,
169 169
         #if ENABLED(HYBRID_THRESHOLD)
170 170
           this->stored.hybrid_thrs = _tmc_thrs(this->microsteps(), this->TPWMTHRS(), planner.settings.axis_steps_per_mm[spmm_id]);
171 171
         #endif
172
-        #if STEALTHCHOP_ENABLED
173
-          this->stored.stealthChop_enabled = !this->en_spreadCycle();
174
-        #endif
175 172
       }
176 173
 
177 174
       inline void refresh_stepper_current() { rms_current(this->val_mA); }

+ 2
- 2
Marlin/src/lcd/menu/menu_tmc.cpp Näytä tiedosto

@@ -241,7 +241,7 @@ void menu_tmc_current() {
241 241
 
242 242
 #endif
243 243
 
244
-#if STEALTHCHOP_ENABLED
244
+#if HAS_STEALTHCHOP
245 245
 
246 246
   #define TMC_EDIT_STEP_MODE(ST) MENU_ITEM_EDIT_CALLBACK(bool, MSG_##ST, &stepper##ST.stored.stealthChop_enabled, refresh_stepping_mode_##ST)
247 247
 
@@ -343,7 +343,7 @@ void menu_tmc() {
343 343
   #if ENABLED(SENSORLESS_HOMING)
344 344
     MENU_ITEM(submenu, MSG_TMC_HOMING_THRS, menu_tmc_homing_thrs);
345 345
   #endif
346
-  #if STEALTHCHOP_ENABLED
346
+  #if HAS_STEALTHCHOP
347 347
     MENU_ITEM(submenu, MSG_TMC_STEPPING_MODE, menu_tmc_step_mode);
348 348
   #endif
349 349
   END_MENU();

Loading…
Peruuta
Tallenna