Minor babystep cleanup patches
This commit is contained in:
parent
cad792e702
commit
00662b8635
|
@ -1125,7 +1125,7 @@ void Stepper::report_positions() {
|
||||||
|
|
||||||
// MUST ONLY BE CALLED BY AN ISR,
|
// MUST ONLY BE CALLED BY AN ISR,
|
||||||
// No other ISR should ever interrupt this!
|
// No other ISR should ever interrupt this!
|
||||||
void Stepper::babystep(const uint8_t axis, const bool direction) {
|
void Stepper::babystep(const AxisEnum axis, const bool direction) {
|
||||||
|
|
||||||
switch (axis) {
|
switch (axis) {
|
||||||
|
|
||||||
|
|
|
@ -257,7 +257,7 @@ class Stepper {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(BABYSTEPPING)
|
#if ENABLED(BABYSTEPPING)
|
||||||
static void babystep(const uint8_t axis, const bool direction); // perform a short step with a single stepper motor, outside of any convention
|
static void babystep(const AxisEnum axis, const bool direction); // perform a short step with a single stepper motor, outside of any convention
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static inline void kill_current_block() {
|
static inline void kill_current_block() {
|
||||||
|
|
|
@ -1916,15 +1916,15 @@ void Temperature::isr() {
|
||||||
} // temp_count >= OVERSAMPLENR
|
} // temp_count >= OVERSAMPLENR
|
||||||
|
|
||||||
#if ENABLED(BABYSTEPPING)
|
#if ENABLED(BABYSTEPPING)
|
||||||
for (uint8_t axis = X_AXIS; axis <= Z_AXIS; axis++) {
|
LOOP_XYZ(axis) {
|
||||||
int curTodo = babystepsTodo[axis]; //get rid of volatile for performance
|
int curTodo = babystepsTodo[axis]; //get rid of volatile for performance
|
||||||
|
|
||||||
if (curTodo > 0) {
|
if (curTodo > 0) {
|
||||||
stepper.babystep(axis,/*fwd*/true);
|
stepper.babystep((AxisEnum)axis,/*fwd*/true);
|
||||||
babystepsTodo[axis]--; //fewer to do next time
|
babystepsTodo[axis]--; //fewer to do next time
|
||||||
}
|
}
|
||||||
else if (curTodo < 0) {
|
else if (curTodo < 0) {
|
||||||
stepper.babystep(axis,/*fwd*/false);
|
stepper.babystep((AxisEnum)axis,/*fwd*/false);
|
||||||
babystepsTodo[axis]++; //fewer to do next time
|
babystepsTodo[axis]++; //fewer to do next time
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -384,7 +384,7 @@ class Temperature {
|
||||||
|
|
||||||
#if ENABLED(BABYSTEPPING)
|
#if ENABLED(BABYSTEPPING)
|
||||||
|
|
||||||
static void babystep_axis(AxisEnum axis, int distance) {
|
static void babystep_axis(const AxisEnum axis, const int distance) {
|
||||||
#if ENABLED(COREXY) || ENABLED(COREXZ) || ENABLED(COREYZ)
|
#if ENABLED(COREXY) || ENABLED(COREXZ) || ENABLED(COREYZ)
|
||||||
#if ENABLED(BABYSTEP_XY)
|
#if ENABLED(BABYSTEP_XY)
|
||||||
switch (axis) {
|
switch (axis) {
|
||||||
|
|
|
@ -651,7 +651,7 @@ void kill_screen(const char* lcd_msg) {
|
||||||
if (lcd_clicked) { defer_return_to_status = false; return lcd_goto_previous_menu(); }
|
if (lcd_clicked) { defer_return_to_status = false; return lcd_goto_previous_menu(); }
|
||||||
ENCODER_DIRECTION_NORMAL();
|
ENCODER_DIRECTION_NORMAL();
|
||||||
if (encoderPosition) {
|
if (encoderPosition) {
|
||||||
int babystep_increment = (int32_t)encoderPosition * BABYSTEP_MULTIPLICATOR;
|
int babystep_increment = (int32_t)encoderPosition * (BABYSTEP_MULTIPLICATOR);
|
||||||
encoderPosition = 0;
|
encoderPosition = 0;
|
||||||
lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
|
lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
|
||||||
thermalManager.babystep_axis(axis, babystep_increment);
|
thermalManager.babystep_axis(axis, babystep_increment);
|
||||||
|
|
Loading…
Reference in a new issue