Skip to content

Commit

Permalink
🐛 Prevent BABYSTEP freeze
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead authored and LCh-77 committed May 11, 2022
1 parent 92ef3ed commit 4af2906
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Marlin/src/module/stepper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3072,7 +3072,12 @@ void Stepper::report_positions() {
#else
#define CYCLES_EATEN_BABYSTEP 0
#endif
#define EXTRA_CYCLES_BABYSTEP (STEP_PULSE_CYCLES - (CYCLES_EATEN_BABYSTEP))

#if CYCLES_EATEN_BABYSTEP < STEP_PULSE_CYCLES
#define EXTRA_CYCLES_BABYSTEP (STEP_PULSE_CYCLES - (CYCLES_EATEN_BABYSTEP))
#else
#define EXTRA_CYCLES_BABYSTEP 0
#endif

#if EXTRA_CYCLES_BABYSTEP > 20
#define _SAVE_START() const hal_timer_t pulse_start = HAL_timer_get_count(MF_TIMER_PULSE)
Expand Down

0 comments on commit 4af2906

Please sign in to comment.