EXPERIMENTAL integrated BABYSTEPPING (#16829)

This commit is contained in:
Scott Lahteine
2020-02-15 21:42:28 -06:00
committed by GitHub
parent 64b96f3908
commit 64a81f887a
6 changed files with 78 additions and 6 deletions

View File

@ -117,6 +117,10 @@ void Babystep::add_steps(const AxisEnum axis, const int16_t distance) {
#if ENABLED(BABYSTEP_ALWAYS_AVAILABLE)
gcode.reset_stepper_timeout();
#endif
#if ENABLED(INTEGRATED_BABYSTEPPING)
if (has_steps()) stepper.initiateBabystepping();
#endif
}
#endif // BABYSTEPPING

View File

@ -23,6 +23,14 @@
#include "../inc/MarlinConfigPre.h"
#if ENABLED(INTEGRATED_BABYSTEPPING)
#define BABYSTEPS_PER_SEC 1000UL
#define BABYSTEP_TICKS ((STEPPER_TIMER_RATE) / (BABYSTEPS_PER_SEC))
#else
#define BABYSTEPS_PER_SEC 976UL
#define BABYSTEP_TICKS ((TEMP_TIMER_RATE) / (BABYSTEPS_PER_SEC))
#endif
#if IS_CORE || EITHER(BABYSTEP_XY, I2C_POSITION_ENCODERS)
#define BS_TODO_AXIS(A) A
#else
@ -56,8 +64,12 @@ public:
static void add_steps(const AxisEnum axis, const int16_t distance);
static void add_mm(const AxisEnum axis, const float &mm);
static inline bool has_steps() {
return steps[BS_TODO_AXIS(X_AXIS)] || steps[BS_TODO_AXIS(Y_AXIS)] || steps[BS_TODO_AXIS(Z_AXIS)];
}
//
// Called by the Temperature ISR to
// Called by the Temperature or Stepper ISR to
// apply accumulated babysteps to the axes.
//
static inline void task() {