|
@@ -2136,8 +2136,7 @@ void Stepper::report_positions() {
|
2136
|
2136
|
#define _APPLY_DIR(AXIS, INVERT) AXIS ##_APPLY_DIR(INVERT, true)
|
2137
|
2137
|
|
2138
|
2138
|
#if EXTRA_CYCLES_BABYSTEP > 20
|
2139
|
|
- hal_timer_t pulse_start;
|
2140
|
|
- #define _SAVE_START pulse_start = HAL_timer_get_count(STEP_TIMER_NUM)
|
|
2139
|
+ #define _SAVE_START const hal_timer_t pulse_start = HAL_timer_get_count(STEP_TIMER_NUM)
|
2141
|
2140
|
#define _PULSE_WAIT while (EXTRA_CYCLES_BABYSTEP > (uint32_t)(HAL_timer_get_count(STEP_TIMER_NUM) - pulse_start) * (PULSE_TIMER_PRESCALE)) { /* nada */ }
|
2142
|
2141
|
#else
|
2143
|
2142
|
#define _SAVE_START NOOP
|
|
@@ -2155,11 +2154,10 @@ void Stepper::report_positions() {
|
2155
|
2154
|
#define BABYSTEP_AXIS(AXIS, INVERT, DIR) { \
|
2156
|
2155
|
const uint8_t old_dir = _READ_DIR(AXIS); \
|
2157
|
2156
|
_ENABLE(AXIS); \
|
2158
|
|
- _SAVE_START; \
|
2159
|
2157
|
_APPLY_DIR(AXIS, _INVERT_DIR(AXIS)^DIR^INVERT); \
|
2160
|
|
- _PULSE_WAIT; \
|
2161
|
|
- _APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS), true); \
|
|
2158
|
+ DELAY_NS(400); /* DRV8825 */ \
|
2162
|
2159
|
_SAVE_START; \
|
|
2160
|
+ _APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS), true); \
|
2163
|
2161
|
_PULSE_WAIT; \
|
2164
|
2162
|
_APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS), true); \
|
2165
|
2163
|
_APPLY_DIR(AXIS, old_dir); \
|
|
@@ -2229,6 +2227,8 @@ void Stepper::report_positions() {
|
2229
|
2227
|
Y_DIR_WRITE(INVERT_Y_DIR ^ z_direction);
|
2230
|
2228
|
Z_DIR_WRITE(INVERT_Z_DIR ^ z_direction);
|
2231
|
2229
|
|
|
2230
|
+ DELAY_NS(400); // DRV8825
|
|
2231
|
+
|
2232
|
2232
|
_SAVE_START;
|
2233
|
2233
|
|
2234
|
2234
|
X_STEP_WRITE(!INVERT_X_STEP_PIN);
|