Browse Source

add delay between pulse edges (#10778)

pull/1/head
Bob Kuhn 7 years ago
committed by Scott Lahteine
parent
commit
9ad42d6617
  1. 4
      Marlin/src/module/stepper.cpp

4
Marlin/src/module/stepper.cpp

@ -2114,7 +2114,8 @@ void Stepper::report_positions() {
#define _APPLY_DIR(AXIS, INVERT) AXIS ##_APPLY_DIR(INVERT, true) #define _APPLY_DIR(AXIS, INVERT) AXIS ##_APPLY_DIR(INVERT, true)
#if EXTRA_CYCLES_BABYSTEP > 20 #if EXTRA_CYCLES_BABYSTEP > 20
#define _SAVE_START const hal_timer_t pulse_start = HAL_timer_get_count(STEP_TIMER_NUM) hal_timer_t pulse_start;
#define _SAVE_START pulse_start = HAL_timer_get_count(STEP_TIMER_NUM)
#define _PULSE_WAIT while (EXTRA_CYCLES_BABYSTEP > (uint32_t)(HAL_timer_get_count(STEP_TIMER_NUM) - pulse_start) * (PULSE_TIMER_PRESCALE)) { /* nada */ } #define _PULSE_WAIT while (EXTRA_CYCLES_BABYSTEP > (uint32_t)(HAL_timer_get_count(STEP_TIMER_NUM) - pulse_start) * (PULSE_TIMER_PRESCALE)) { /* nada */ }
#else #else
#define _SAVE_START NOOP #define _SAVE_START NOOP
@ -2136,6 +2137,7 @@ void Stepper::report_positions() {
_APPLY_DIR(AXIS, _INVERT_DIR(AXIS)^DIR^INVERT); \ _APPLY_DIR(AXIS, _INVERT_DIR(AXIS)^DIR^INVERT); \
_PULSE_WAIT; \ _PULSE_WAIT; \
_APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS), true); \ _APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS), true); \
_SAVE_START; \
_PULSE_WAIT; \ _PULSE_WAIT; \
_APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS), true); \ _APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS), true); \
_APPLY_DIR(AXIS, old_dir); \ _APPLY_DIR(AXIS, old_dir); \

Loading…
Cancel
Save