mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2024-11-27 13:56:24 +00:00
Add CorePQ support for BABYSTEPPING (#10074)
This commit is contained in:
parent
af3500044a
commit
a66ae52234
@ -1325,16 +1325,16 @@ void Stepper::report_positions() {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define BABYSTEP_AXIS(AXIS, INVERT) { \
|
||||
const uint8_t old_dir = _READ_DIR(AXIS); \
|
||||
_ENABLE(AXIS); \
|
||||
_SAVE_START; \
|
||||
_APPLY_DIR(AXIS, _INVERT_DIR(AXIS)^direction^INVERT); \
|
||||
_PULSE_WAIT; \
|
||||
_APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS), true); \
|
||||
_PULSE_WAIT; \
|
||||
_APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS), true); \
|
||||
_APPLY_DIR(AXIS, old_dir); \
|
||||
#define BABYSTEP_AXIS(AXIS, INVERT, DIR) { \
|
||||
const uint8_t old_dir = _READ_DIR(AXIS); \
|
||||
_ENABLE(AXIS); \
|
||||
_SAVE_START; \
|
||||
_APPLY_DIR(AXIS, _INVERT_DIR(AXIS)^DIR^INVERT); \
|
||||
_PULSE_WAIT; \
|
||||
_APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS), true); \
|
||||
_PULSE_WAIT; \
|
||||
_APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS), true); \
|
||||
_APPLY_DIR(AXIS, old_dir); \
|
||||
}
|
||||
|
||||
// MUST ONLY BE CALLED BY AN ISR,
|
||||
@ -1347,20 +1347,43 @@ void Stepper::report_positions() {
|
||||
#if ENABLED(BABYSTEP_XY)
|
||||
|
||||
case X_AXIS:
|
||||
BABYSTEP_AXIS(X, false);
|
||||
#if CORE_IS_XY
|
||||
BABYSTEP_AXIS(X, false, direction);
|
||||
BABYSTEP_AXIS(Y, false, direction);
|
||||
#elif CORE_IS_XZ
|
||||
BABYSTEP_AXIS(X, false, direction);
|
||||
BABYSTEP_AXIS(Z, false, direction);
|
||||
#else
|
||||
BABYSTEP_AXIS(X, false, direction);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case Y_AXIS:
|
||||
BABYSTEP_AXIS(Y, false);
|
||||
#if CORE_IS_XY
|
||||
BABYSTEP_AXIS(X, false, direction);
|
||||
BABYSTEP_AXIS(Y, false, direction^(CORESIGN(1)<0));
|
||||
#elif CORE_IS_YZ
|
||||
BABYSTEP_AXIS(Y, false, direction);
|
||||
BABYSTEP_AXIS(Z, false, direction^(CORESIGN(1)<0));
|
||||
#else
|
||||
BABYSTEP_AXIS(Y, false, direction);
|
||||
#endif
|
||||
break;
|
||||
|
||||
#endif
|
||||
|
||||
case Z_AXIS: {
|
||||
|
||||
#if DISABLED(DELTA)
|
||||
#if CORE_IS_XZ
|
||||
BABYSTEP_AXIS(X, BABYSTEP_INVERT_Z, direction);
|
||||
BABYSTEP_AXIS(Z, BABYSTEP_INVERT_Z, direction^(CORESIGN(1)<0));
|
||||
|
||||
BABYSTEP_AXIS(Z, BABYSTEP_INVERT_Z);
|
||||
#elif CORE_IS_YZ
|
||||
BABYSTEP_AXIS(Y, BABYSTEP_INVERT_Z, direction);
|
||||
BABYSTEP_AXIS(Z, BABYSTEP_INVERT_Z, direction^(CORESIGN(1)<0));
|
||||
|
||||
#elif DISABLED(DELTA)
|
||||
BABYSTEP_AXIS(Z, BABYSTEP_INVERT_Z, direction);
|
||||
|
||||
#else // DELTA
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user