Ensure pulse delay in babystepping

Proposed alternative to #10778
This commit is contained in:
Scott Lahteine 2018-05-19 17:17:03 -05:00
parent 6f10d637ad
commit 4e3793988a

View File

@ -2095,9 +2095,9 @@ void Stepper::report_positions() {
#define BABYSTEP_AXIS(AXIS, INVERT, DIR) { \ #define BABYSTEP_AXIS(AXIS, INVERT, DIR) { \
const uint8_t old_dir = _READ_DIR(AXIS); \ const uint8_t old_dir = _READ_DIR(AXIS); \
_ENABLE(AXIS); \ _ENABLE(AXIS); \
_SAVE_START; \
_APPLY_DIR(AXIS, _INVERT_DIR(AXIS)^DIR^INVERT); \ _APPLY_DIR(AXIS, _INVERT_DIR(AXIS)^DIR^INVERT); \
_PULSE_WAIT; \ DELAY_NS(400); /* DRV8825 */ \
_SAVE_START; \
_APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS), true); \ _APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS), true); \
_PULSE_WAIT; \ _PULSE_WAIT; \
_APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS), true); \ _APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS), true); \
@ -2168,6 +2168,8 @@ void Stepper::report_positions() {
Y_DIR_WRITE(INVERT_Y_DIR ^ z_direction); Y_DIR_WRITE(INVERT_Y_DIR ^ z_direction);
Z_DIR_WRITE(INVERT_Z_DIR ^ z_direction); Z_DIR_WRITE(INVERT_Z_DIR ^ z_direction);
DELAY_NS(400); // DRV8825
_SAVE_START; _SAVE_START;
X_STEP_WRITE(!INVERT_X_STEP_PIN); X_STEP_WRITE(!INVERT_X_STEP_PIN);