parent
4c6f695bea
commit
99a5074372
|
@ -44,7 +44,7 @@ int16_t Babystep::accum;
|
||||||
void Babystep::step_axis(const AxisEnum axis) {
|
void Babystep::step_axis(const AxisEnum axis) {
|
||||||
const int16_t curTodo = steps[BS_TODO_AXIS(axis)]; // get rid of volatile for performance
|
const int16_t curTodo = steps[BS_TODO_AXIS(axis)]; // get rid of volatile for performance
|
||||||
if (curTodo) {
|
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)]++;
|
if (curTodo > 0) steps[BS_TODO_AXIS(axis)]--; else steps[BS_TODO_AXIS(axis)]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,6 +101,10 @@ Stepper stepper; // Singleton
|
||||||
#include "../MarlinCore.h"
|
#include "../MarlinCore.h"
|
||||||
#include "../HAL/shared/Delay.h"
|
#include "../HAL/shared/Delay.h"
|
||||||
|
|
||||||
|
#if ENABLED(INTEGRATED_BABYSTEPPING)
|
||||||
|
#include "../feature/babystep.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if MB(ALLIGATOR)
|
#if MB(ALLIGATOR)
|
||||||
#include "../feature/dac/dac_dac084s085.h"
|
#include "../feature/dac/dac_dac084s085.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -1373,10 +1377,10 @@ void Stepper::isr() {
|
||||||
|
|
||||||
#if ENABLED(INTEGRATED_BABYSTEPPING)
|
#if ENABLED(INTEGRATED_BABYSTEPPING)
|
||||||
if (do_babystep) // Avoid ANY stepping too soon after baby-stepping
|
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
|
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
|
#endif
|
||||||
|
|
||||||
// Get the interval to the next ISR call
|
// Get the interval to the next ISR call
|
||||||
|
@ -2544,7 +2548,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 AxisEnum axis, const bool direction) {
|
void Stepper::do_babystep(const AxisEnum axis, const bool direction) {
|
||||||
|
|
||||||
#if DISABLED(INTEGRATED_BABYSTEPPING)
|
#if DISABLED(INTEGRATED_BABYSTEPPING)
|
||||||
cli();
|
cli();
|
||||||
|
|
|
@ -471,7 +471,7 @@ class Stepper {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(BABYSTEPPING)
|
#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
|
#endif
|
||||||
|
|
||||||
#if HAS_MOTOR_CURRENT_PWM
|
#if HAS_MOTOR_CURRENT_PWM
|
||||||
|
|
Loading…
Reference in a new issue