|
@@ -58,7 +58,12 @@ void GcodeSuite::G92() {
|
58
|
58
|
#define IS_G92_0 true
|
59
|
59
|
#endif
|
60
|
60
|
|
61
|
|
- bool didXYZ = false, didE = false;
|
|
61
|
+ bool didE = false;
|
|
62
|
+ #if IS_SCARA || !HAS_POSITION_SHIFT
|
|
63
|
+ bool didXYZ = false;
|
|
64
|
+ #else
|
|
65
|
+ constexpr bool didXYZ = false;
|
|
66
|
+ #endif
|
62
|
67
|
|
63
|
68
|
if (IS_G92_0) LOOP_XYZE(i) {
|
64
|
69
|
if (parser.seenval(axis_codes[i])) {
|
|
@@ -66,18 +71,18 @@ void GcodeSuite::G92() {
|
66
|
71
|
v = i == E_AXIS ? l : LOGICAL_TO_NATIVE(l, i),
|
67
|
72
|
d = v - current_position[i];
|
68
|
73
|
if (!NEAR_ZERO(d)) {
|
69
|
|
- if (i == E_AXIS) didE = true; else didXYZ = true;
|
70
|
|
- #if IS_SCARA
|
71
|
|
- current_position[i] = v; // For SCARA just set the position directly
|
|
74
|
+ #if IS_SCARA || !HAS_POSITION_SHIFT
|
|
75
|
+ if (i == E_AXIS) didE = true; else didXYZ = true;
|
|
76
|
+ current_position[i] = v; // Without workspaces revert to Marlin 1.0 behavior
|
72
|
77
|
#elif HAS_POSITION_SHIFT
|
73
|
|
- if (i == E_AXIS)
|
|
78
|
+ if (i == E_AXIS) {
|
|
79
|
+ didE = true;
|
74
|
80
|
current_position[E_AXIS] = v; // When using coordinate spaces, only E is set directly
|
|
81
|
+ }
|
75
|
82
|
else {
|
76
|
83
|
position_shift[i] += d; // Other axes simply offset the coordinate space
|
77
|
84
|
update_software_endstops((AxisEnum)i);
|
78
|
85
|
}
|
79
|
|
- #else
|
80
|
|
- current_position[i] = v; // Without workspaces revert to Marlin 1.0 behavior
|
81
|
86
|
#endif
|
82
|
87
|
}
|
83
|
88
|
}
|