File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -162,32 +162,37 @@ int32_t Backlash::get_applied_steps(const AxisEnum axis) {
162162}
163163
164164class Backlash ::StepAdjuster {
165- xyz_long_t applied_steps;
166- public:
167- StepAdjuster () {
168- LOOP_NUM_AXES (axis) applied_steps[axis] = backlash.get_applied_steps ((AxisEnum)axis);
169- }
170- ~StepAdjuster () {
171- // after backlash compensation parameter changes, ensure applied step count does not change
172- LOOP_NUM_AXES (axis) residual_error[axis] += backlash.get_applied_steps ((AxisEnum)axis) - applied_steps[axis];
173- }
165+ private:
166+ xyz_long_t applied_steps;
167+ public:
168+ StepAdjuster () {
169+ LOOP_NUM_AXES (axis) applied_steps[axis] = backlash.get_applied_steps ((AxisEnum)axis);
170+ }
171+ ~StepAdjuster () {
172+ // after backlash compensation parameter changes, ensure applied step count does not change
173+ LOOP_NUM_AXES (axis) residual_error[axis] += backlash.get_applied_steps ((AxisEnum)axis) - applied_steps[axis];
174+ }
174175};
175176
176- void Backlash::set_correction_uint8 (const uint8_t v) {
177- StepAdjuster adjuster;
178- correction = v;
179- }
177+ #if ENABLED(BACKLASH_GCODE)
180178
181- void Backlash::set_distance_mm (const AxisEnum axis, const float v) {
182- StepAdjuster adjuster;
183- distance_mm[axis] = v;
184- }
179+ void Backlash::set_correction_uint8 (const uint8_t v) {
180+ StepAdjuster adjuster;
181+ correction = v;
182+ }
185183
186- #ifdef BACKLASH_SMOOTHING_MM
187- void Backlash::set_smoothing_mm (const float v) {
184+ void Backlash::set_distance_mm (const AxisEnum axis, const float v) {
188185 StepAdjuster adjuster;
189- smoothing_mm = v;
186+ distance_mm[axis] = v;
190187 }
188+
189+ #ifdef BACKLASH_SMOOTHING_MM
190+ void Backlash::set_smoothing_mm (const float v) {
191+ StepAdjuster adjuster;
192+ smoothing_mm = v;
193+ }
194+ #endif
195+
191196#endif
192197
193198#if ENABLED(MEASURE_BACKLASH_WHEN_PROBING)
You can’t perform that action at this time.
0 commit comments