|
@@ -120,15 +120,12 @@ class TMCMarlin : public TMC, public TMCStorage<AXIS_LETTER, DRIVER_ID> {
|
120
|
120
|
uint32_t get_pwm_thrs() {
|
121
|
121
|
return _tmc_thrs(this->microsteps(), this->TPWMTHRS(), planner.settings.axis_steps_per_mm[AXIS_ID]);
|
122
|
122
|
}
|
|
123
|
+ void set_pwm_thrs(const uint32_t thrs) {
|
|
124
|
+ TMC::TPWMTHRS(_tmc_thrs(this->microsteps(), thrs, planner.settings.axis_steps_per_mm[AXIS_ID]));
|
|
125
|
+ TERN_(HAS_LCD_MENU, this->stored.hybrid_thrs = thrs);
|
|
126
|
+ }
|
123
|
127
|
#endif
|
124
|
128
|
|
125
|
|
- void set_pwm_thrs(const uint32_t thrs) {
|
126
|
|
- TMC::TPWMTHRS(_tmc_thrs(this->microsteps(), thrs, planner.settings.axis_steps_per_mm[AXIS_ID]));
|
127
|
|
- #if BOTH(HYBRID_THRESHOLD, HAS_LCD_MENU)
|
128
|
|
- this->stored.hybrid_thrs = thrs;
|
129
|
|
- #endif
|
130
|
|
- }
|
131
|
|
-
|
132
|
129
|
#if USE_SENSORLESS
|
133
|
130
|
inline int16_t homing_threshold() { return TMC::sgt(); }
|
134
|
131
|
void homing_threshold(int16_t sgt_val) {
|
|
@@ -188,21 +185,19 @@ class TMCMarlin<TMC2208Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> : public TMC220
|
188
|
185
|
inline bool toggle_stepping_mode() { set_stealthChop(!this->stored.stealthChop_enabled); return get_stealthChop(); }
|
189
|
186
|
#endif
|
190
|
187
|
|
191
|
|
- void set_pwm_thrs(const uint32_t thrs) {
|
192
|
|
- TMC2208Stepper::TPWMTHRS(_tmc_thrs(this->microsteps(), thrs, planner.settings.axis_steps_per_mm[AXIS_ID]));
|
193
|
|
- #if BOTH(HYBRID_THRESHOLD, HAS_LCD_MENU)
|
194
|
|
- this->stored.hybrid_thrs = thrs;
|
195
|
|
- #endif
|
196
|
|
- }
|
197
|
|
-
|
198
|
188
|
#if ENABLED(HYBRID_THRESHOLD)
|
199
|
189
|
uint32_t get_pwm_thrs() {
|
200
|
190
|
return _tmc_thrs(this->microsteps(), this->TPWMTHRS(), planner.settings.axis_steps_per_mm[AXIS_ID]);
|
201
|
191
|
}
|
|
192
|
+ void set_pwm_thrs(const uint32_t thrs) {
|
|
193
|
+ TMC2208Stepper::TPWMTHRS(_tmc_thrs(this->microsteps(), thrs, planner.settings.axis_steps_per_mm[AXIS_ID]));
|
|
194
|
+ TERN_(HAS_LCD_MENU, this->stored.hybrid_thrs = thrs);
|
|
195
|
+ }
|
202
|
196
|
#endif
|
203
|
197
|
|
204
|
198
|
#if HAS_LCD_MENU
|
205
|
199
|
inline void refresh_stepper_current() { rms_current(this->val_mA); }
|
|
200
|
+
|
206
|
201
|
#if ENABLED(HYBRID_THRESHOLD)
|
207
|
202
|
inline void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); }
|
208
|
203
|
#endif
|
|
@@ -242,15 +237,11 @@ class TMCMarlin<TMC2209Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> : public TMC220
|
242
|
237
|
uint32_t get_pwm_thrs() {
|
243
|
238
|
return _tmc_thrs(this->microsteps(), this->TPWMTHRS(), planner.settings.axis_steps_per_mm[AXIS_ID]);
|
244
|
239
|
}
|
|
240
|
+ void set_pwm_thrs(const uint32_t thrs) {
|
|
241
|
+ TMC2209Stepper::TPWMTHRS(_tmc_thrs(this->microsteps(), thrs, planner.settings.axis_steps_per_mm[AXIS_ID]));
|
|
242
|
+ TERN_(HAS_LCD_MENU, this->stored.hybrid_thrs = thrs);
|
|
243
|
+ }
|
245
|
244
|
#endif
|
246
|
|
-
|
247
|
|
- void set_pwm_thrs(const uint32_t thrs) {
|
248
|
|
- TMC2209Stepper::TPWMTHRS(_tmc_thrs(this->microsteps(), thrs, planner.settings.axis_steps_per_mm[AXIS_ID]));
|
249
|
|
- #if BOTH(HYBRID_THRESHOLD, HAS_LCD_MENU)
|
250
|
|
- this->stored.hybrid_thrs = thrs;
|
251
|
|
- #endif
|
252
|
|
- }
|
253
|
|
-
|
254
|
245
|
#if USE_SENSORLESS
|
255
|
246
|
inline int16_t homing_threshold() { return TMC2209Stepper::SGTHRS(); }
|
256
|
247
|
void homing_threshold(int16_t sgt_val) {
|