Fix babystep include, typos in stepper.cpp

Fix #16881
This commit is contained in:
Scott Lahteine 2020-02-16 17:46:41 -06:00
parent 4c6f695bea
commit 99a5074372
3 changed files with 9 additions and 5 deletions

View File

@ -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)]++;
}
}

View File

@ -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();

View File

@ -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