From 99a50743727e2076c19d8f9469090c3ddd6f9a93 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 16 Feb 2020 17:46:41 -0600 Subject: [PATCH] Fix babystep include, typos in stepper.cpp Fix #16881 --- Marlin/src/feature/babystep.cpp | 2 +- Marlin/src/module/stepper.cpp | 10 +++++++--- Marlin/src/module/stepper.h | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Marlin/src/feature/babystep.cpp b/Marlin/src/feature/babystep.cpp index be2d1b0d2..fd4491bc6 100644 --- a/Marlin/src/feature/babystep.cpp +++ b/Marlin/src/feature/babystep.cpp @@ -44,7 +44,7 @@ int16_t Babystep::accum; void Babystep::step_axis(const AxisEnum axis) { const int16_t curTodo = steps[BS_TODO_AXIS(axis)]; // get rid of volatile for performance if (curTodo) { - stepper.babystep((AxisEnum)axis, curTodo > 0); + stepper.do_babystep((AxisEnum)axis, curTodo > 0); if (curTodo > 0) steps[BS_TODO_AXIS(axis)]--; else steps[BS_TODO_AXIS(axis)]++; } } diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index e898d974e..0a79855bc 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -101,6 +101,10 @@ Stepper stepper; // Singleton #include "../MarlinCore.h" #include "../HAL/shared/Delay.h" +#if ENABLED(INTEGRATED_BABYSTEPPING) + #include "../feature/babystep.h" +#endif + #if MB(ALLIGATOR) #include "../feature/dac/dac_dac084s085.h" #endif @@ -1373,10 +1377,10 @@ void Stepper::isr() { #if ENABLED(INTEGRATED_BABYSTEPPING) if (do_babystep) // Avoid ANY stepping too soon after baby-stepping - NOLESS(nextMainISR, (BABYSTEP_TICKS) / 8) // FULL STOP for 125µs after a baby-step + NOLESS(nextMainISR, (BABYSTEP_TICKS) / 8); // FULL STOP for 125µs after a baby-step if (nextBabystepISR != BABYSTEP_NEVER) // Avoid baby-stepping too close to axis Stepping - NOLESS(nextBabystepISR, nextMainISR / 2) // TODO: Only look at axes enabled for baby-stepping + NOLESS(nextBabystepISR, nextMainISR / 2); // TODO: Only look at axes enabled for baby-stepping #endif // Get the interval to the next ISR call @@ -2544,7 +2548,7 @@ void Stepper::report_positions() { // MUST ONLY BE CALLED BY AN ISR, // No other ISR should ever interrupt this! - void Stepper::babystep(const AxisEnum axis, const bool direction) { + void Stepper::do_babystep(const AxisEnum axis, const bool direction) { #if DISABLED(INTEGRATED_BABYSTEPPING) cli(); diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h index 9f1b9321b..6671b946d 100644 --- a/Marlin/src/module/stepper.h +++ b/Marlin/src/module/stepper.h @@ -471,7 +471,7 @@ class Stepper { #endif #if ENABLED(BABYSTEPPING) - static void babystep(const AxisEnum axis, const bool direction); // perform a short step with a single stepper motor, outside of any convention + static void do_babystep(const AxisEnum axis, const bool direction); // perform a short step with a single stepper motor, outside of any convention #endif #if HAS_MOTOR_CURRENT_PWM