Commit dbf13a8b authored by MagoKimbra's avatar MagoKimbra

Dix stepper

parent e9d95297
...@@ -726,29 +726,29 @@ ISR(TIMER1_COMPA_vect) { ...@@ -726,29 +726,29 @@ ISR(TIMER1_COMPA_vect) {
#define _APPLY_STEP(AXIS) AXIS ##_APPLY_STEP #define _APPLY_STEP(AXIS) AXIS ##_APPLY_STEP
#define _INVERT_STEP_PIN(AXIS) INVERT_## AXIS ##_STEP_PIN #define _INVERT_STEP_PIN(AXIS) INVERT_## AXIS ##_STEP_PIN
#define STEP_START(axis, AXIS) \ #define STEP_ADD(axis, AXIS) \
_COUNTER(axis) += current_block->steps[_AXIS(AXIS)]; \ _COUNTER(axis) += current_block->steps[_AXIS(AXIS)]; \
if (_COUNTER(axis) > 0) { \ if (_COUNTER(axis) > 0) { _APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS),0); }
_APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS),0); \
_COUNTER(axis) -= current_block->step_event_count; \
count_position[_AXIS(AXIS)] += count_direction[_AXIS(AXIS)]; }
STEP_START(x,X); STEP_ADD(x,X);
STEP_START(y,Y); STEP_ADD(y,Y);
STEP_START(z,Z); STEP_ADD(z,Z);
#ifndef ADVANCE #ifndef ADVANCE
STEP_START(e,E); STEP_ADD(e,E);
#endif #endif
delayMicroseconds(1); #define STEP_IF_COUNTER(axis, AXIS) \
if (_COUNTER(axis) > 0) { \
#define STEP_END(axis, AXIS) _APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS),0) _COUNTER(axis) -= current_block->step_event_count; \
count_position[_AXIS(AXIS)] += count_direction[_AXIS(AXIS)]; \
_APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS),0); \
}
STEP_END(x, X); STEP_IF_COUNTER(x, X);
STEP_END(y, Y); STEP_IF_COUNTER(y, Y);
STEP_END(z, Z); STEP_IF_COUNTER(z, Z);
#ifndef ADVANCE #ifndef ADVANCE
STEP_END(e, E); STEP_IF_COUNTER(e, E);
#endif #endif
step_events_completed++; step_events_completed++;
...@@ -782,7 +782,6 @@ ISR(TIMER1_COMPA_vect) { ...@@ -782,7 +782,6 @@ ISR(TIMER1_COMPA_vect) {
#endif #endif
} }
else if (step_events_completed > (unsigned long)current_block->decelerate_after) { else if (step_events_completed > (unsigned long)current_block->decelerate_after) {
MultiU24X32toH16(step_rate, deceleration_time, current_block->acceleration_rate); MultiU24X32toH16(step_rate, deceleration_time, current_block->acceleration_rate);
if (step_rate > acc_step_rate) { // Check step_rate stays positive if (step_rate > acc_step_rate) { // Check step_rate stays positive
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment