|
@ -982,8 +982,8 @@ void Stepper::set_position(const long &a, const long &b, const long &c, const lo |
|
|
#elif ENABLED(COREYZ) |
|
|
#elif ENABLED(COREYZ) |
|
|
// coreyz planning
|
|
|
// coreyz planning
|
|
|
count_position[X_AXIS] = a; |
|
|
count_position[X_AXIS] = a; |
|
|
count_position[B_AXIS] = y + c; |
|
|
count_position[B_AXIS] = b + c; |
|
|
count_position[C_AXIS] = y - c; |
|
|
count_position[C_AXIS] = b - c; |
|
|
#else |
|
|
#else |
|
|
// default non-h-bot planning
|
|
|
// default non-h-bot planning
|
|
|
count_position[X_AXIS] = a; |
|
|
count_position[X_AXIS] = a; |
|
@ -1108,24 +1108,24 @@ void Stepper::report_positions() { |
|
|
|
|
|
|
|
|
#if ENABLED(BABYSTEPPING) |
|
|
#if ENABLED(BABYSTEPPING) |
|
|
|
|
|
|
|
|
|
|
|
#define _ENABLE(axis) enable_## axis() |
|
|
|
|
|
#define _READ_DIR(AXIS) AXIS ##_DIR_READ |
|
|
|
|
|
#define _INVERT_DIR(AXIS) INVERT_## AXIS ##_DIR |
|
|
|
|
|
#define _APPLY_DIR(AXIS, INVERT) AXIS ##_APPLY_DIR(INVERT, true) |
|
|
|
|
|
|
|
|
|
|
|
#define BABYSTEP_AXIS(axis, AXIS, INVERT) { \ |
|
|
|
|
|
_ENABLE(axis); \ |
|
|
|
|
|
uint8_t old_pin = _READ_DIR(AXIS); \ |
|
|
|
|
|
_APPLY_DIR(AXIS, _INVERT_DIR(AXIS)^direction^INVERT); \ |
|
|
|
|
|
_APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS), true); \ |
|
|
|
|
|
delayMicroseconds(2); \ |
|
|
|
|
|
_APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS), true); \ |
|
|
|
|
|
_APPLY_DIR(AXIS, old_pin); \ |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// MUST ONLY BE CALLED BY AN ISR,
|
|
|
// MUST ONLY BE CALLED BY AN ISR,
|
|
|
// No other ISR should ever interrupt this!
|
|
|
// No other ISR should ever interrupt this!
|
|
|
void Stepper::babystep(const uint8_t axis, const bool direction) { |
|
|
void Stepper::babystep(const AxisEnum axis, const bool direction) { |
|
|
|
|
|
|
|
|
#define _ENABLE(axis) enable_## axis() |
|
|
|
|
|
#define _READ_DIR(AXIS) AXIS ##_DIR_READ |
|
|
|
|
|
#define _INVERT_DIR(AXIS) INVERT_## AXIS ##_DIR |
|
|
|
|
|
#define _APPLY_DIR(AXIS, INVERT) AXIS ##_APPLY_DIR(INVERT, true) |
|
|
|
|
|
|
|
|
|
|
|
#define BABYSTEP_AXIS(axis, AXIS, INVERT) { \ |
|
|
|
|
|
_ENABLE(axis); \ |
|
|
|
|
|
uint8_t old_pin = _READ_DIR(AXIS); \ |
|
|
|
|
|
_APPLY_DIR(AXIS, _INVERT_DIR(AXIS)^direction^INVERT); \ |
|
|
|
|
|
_APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS), true); \ |
|
|
|
|
|
delayMicroseconds(2); \ |
|
|
|
|
|
_APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS), true); \ |
|
|
|
|
|
_APPLY_DIR(AXIS, old_pin); \ |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
switch (axis) { |
|
|
switch (axis) { |
|
|
|
|
|
|
|
|