Clean up stepper and babystep (#16857)

This commit is contained in:
Scott Lahteine
2020-02-14 05:14:37 -06:00
committed by GitHub
parent 073e4443e8
commit 0b984519c3
8 changed files with 242 additions and 240 deletions

View File

@@ -49,14 +49,6 @@ void Babystep::step_axis(const AxisEnum axis) {
}
}
void Babystep::task() {
#if EITHER(BABYSTEP_XY, I2C_POSITION_ENCODERS)
LOOP_XYZ(axis) step_axis((AxisEnum)axis);
#else
step_axis(Z_AXIS);
#endif
}
void Babystep::add_mm(const AxisEnum axis, const float &mm) {
add_steps(axis, mm * planner.settings.axis_steps_per_mm[axis]);
}

View File

@@ -55,7 +55,15 @@ public:
static void add_steps(const AxisEnum axis, const int16_t distance);
static void add_mm(const AxisEnum axis, const float &mm);
static void task();
//
// Called by the Temperature ISR to
// apply accumulated babysteps to the axes.
//
static inline void task() {
LOOP_L_N(axis, BS_TODO_AXIS(Z_AXIS)) step_axis((AxisEnum)axis);
}
private:
static void step_axis(const AxisEnum axis);
};