|
@@ -2114,7 +2114,8 @@ void Stepper::report_positions() {
|
2114
|
2114
|
#define _APPLY_DIR(AXIS, INVERT) AXIS ##_APPLY_DIR(INVERT, true)
|
2115
|
2115
|
|
2116
|
2116
|
#if EXTRA_CYCLES_BABYSTEP > 20
|
2117
|
|
- #define _SAVE_START const hal_timer_t pulse_start = HAL_timer_get_count(STEP_TIMER_NUM)
|
|
2117
|
+ hal_timer_t pulse_start;
|
|
2118
|
+ #define _SAVE_START pulse_start = HAL_timer_get_count(STEP_TIMER_NUM)
|
2118
|
2119
|
#define _PULSE_WAIT while (EXTRA_CYCLES_BABYSTEP > (uint32_t)(HAL_timer_get_count(STEP_TIMER_NUM) - pulse_start) * (PULSE_TIMER_PRESCALE)) { /* nada */ }
|
2119
|
2120
|
#else
|
2120
|
2121
|
#define _SAVE_START NOOP
|
|
@@ -2136,6 +2137,7 @@ void Stepper::report_positions() {
|
2136
|
2137
|
_APPLY_DIR(AXIS, _INVERT_DIR(AXIS)^DIR^INVERT); \
|
2137
|
2138
|
_PULSE_WAIT; \
|
2138
|
2139
|
_APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS), true); \
|
|
2140
|
+ _SAVE_START; \
|
2139
|
2141
|
_PULSE_WAIT; \
|
2140
|
2142
|
_APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS), true); \
|
2141
|
2143
|
_APPLY_DIR(AXIS, old_dir); \
|