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

@ -329,6 +329,11 @@ class Stepper {
static bool LA_use_advance_lead;
#endif
#if ENABLED(INTEGRATED_BABYSTEPPING)
static constexpr uint32_t BABYSTEP_NEVER = 0xFFFFFFFF;
static uint32_t nextBabystepISR;
#endif
static int32_t ticks_nominal;
#if DISABLED(S_CURVE_ACCELERATION)
static uint32_t acc_step_rate; // needed for deceleration start point
@ -383,6 +388,17 @@ class Stepper {
FORCE_INLINE static void initiateLA() { nextAdvanceISR = 0; }
#endif
#if ENABLED(INTEGRATED_BABYSTEPPING)
// The Babystepping ISR phase
static uint32_t babystepping_isr();
FORCE_INLINE static void initiateBabystepping() {
if (nextBabystepISR == BABYSTEP_NEVER) {
nextBabystepISR = 0;
wake_up();
}
}
#endif
// Check if the given block is busy or not - Must not be called from ISR contexts
static bool is_block_busy(const block_t* const block);