|
@@ -982,8 +982,8 @@ void Stepper::set_position(const long &a, const long &b, const long &c, const lo
|
982
|
982
|
#elif ENABLED(COREYZ)
|
983
|
983
|
// coreyz planning
|
984
|
984
|
count_position[X_AXIS] = a;
|
985
|
|
- count_position[B_AXIS] = y + c;
|
986
|
|
- count_position[C_AXIS] = y - c;
|
|
985
|
+ count_position[B_AXIS] = b + c;
|
|
986
|
+ count_position[C_AXIS] = b - c;
|
987
|
987
|
#else
|
988
|
988
|
// default non-h-bot planning
|
989
|
989
|
count_position[X_AXIS] = a;
|
|
@@ -1108,24 +1108,24 @@ void Stepper::report_positions() {
|
1108
|
1108
|
|
1109
|
1109
|
#if ENABLED(BABYSTEPPING)
|
1110
|
1110
|
|
|
1111
|
+ #define _ENABLE(axis) enable_## axis()
|
|
1112
|
+ #define _READ_DIR(AXIS) AXIS ##_DIR_READ
|
|
1113
|
+ #define _INVERT_DIR(AXIS) INVERT_## AXIS ##_DIR
|
|
1114
|
+ #define _APPLY_DIR(AXIS, INVERT) AXIS ##_APPLY_DIR(INVERT, true)
|
|
1115
|
+
|
|
1116
|
+ #define BABYSTEP_AXIS(axis, AXIS, INVERT) { \
|
|
1117
|
+ _ENABLE(axis); \
|
|
1118
|
+ uint8_t old_pin = _READ_DIR(AXIS); \
|
|
1119
|
+ _APPLY_DIR(AXIS, _INVERT_DIR(AXIS)^direction^INVERT); \
|
|
1120
|
+ _APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS), true); \
|
|
1121
|
+ delayMicroseconds(2); \
|
|
1122
|
+ _APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS), true); \
|
|
1123
|
+ _APPLY_DIR(AXIS, old_pin); \
|
|
1124
|
+ }
|
|
1125
|
+
|
1111
|
1126
|
// MUST ONLY BE CALLED BY AN ISR,
|
1112
|
1127
|
// No other ISR should ever interrupt this!
|
1113
|
|
- void Stepper::babystep(const uint8_t axis, const bool direction) {
|
1114
|
|
-
|
1115
|
|
- #define _ENABLE(axis) enable_## axis()
|
1116
|
|
- #define _READ_DIR(AXIS) AXIS ##_DIR_READ
|
1117
|
|
- #define _INVERT_DIR(AXIS) INVERT_## AXIS ##_DIR
|
1118
|
|
- #define _APPLY_DIR(AXIS, INVERT) AXIS ##_APPLY_DIR(INVERT, true)
|
1119
|
|
-
|
1120
|
|
- #define BABYSTEP_AXIS(axis, AXIS, INVERT) { \
|
1121
|
|
- _ENABLE(axis); \
|
1122
|
|
- uint8_t old_pin = _READ_DIR(AXIS); \
|
1123
|
|
- _APPLY_DIR(AXIS, _INVERT_DIR(AXIS)^direction^INVERT); \
|
1124
|
|
- _APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS), true); \
|
1125
|
|
- delayMicroseconds(2); \
|
1126
|
|
- _APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS), true); \
|
1127
|
|
- _APPLY_DIR(AXIS, old_pin); \
|
1128
|
|
- }
|
|
1128
|
+ void Stepper::babystep(const AxisEnum axis, const bool direction) {
|
1129
|
1129
|
|
1130
|
1130
|
switch (axis) {
|
1131
|
1131
|
|