|
@@ -405,6 +405,9 @@ float filament_size[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(DEFAULT_NOMINAL_FILAMENT_DI
|
405
|
405
|
// Set by M206, M428, or menu item. Saved to EEPROM.
|
406
|
406
|
float home_offset[XYZ] = { 0 };
|
407
|
407
|
|
|
408
|
+ // The above two are combined to save on computes
|
|
409
|
+ float workspace_offset[XYZ] = { 0 };
|
|
410
|
+
|
408
|
411
|
#endif
|
409
|
412
|
|
410
|
413
|
// Software Endstops are based on the configured limits.
|
|
@@ -1349,7 +1352,7 @@ bool get_target_extruder_from_command(int code) {
|
1349
|
1352
|
* at the same positions relative to the machine.
|
1350
|
1353
|
*/
|
1351
|
1354
|
void update_software_endstops(const AxisEnum axis) {
|
1352
|
|
- const float offs = LOGICAL_POSITION(0, axis);
|
|
1355
|
+ const float offs = workspace_offset[axis] = LOGICAL_POSITION(0, axis);
|
1353
|
1356
|
|
1354
|
1357
|
#if ENABLED(DUAL_X_CARRIAGE)
|
1355
|
1358
|
if (axis == X_AXIS) {
|
|
@@ -1408,7 +1411,7 @@ bool get_target_extruder_from_command(int code) {
|
1408
|
1411
|
* Since this changes the current_position, code should
|
1409
|
1412
|
* call sync_plan_position soon after this.
|
1410
|
1413
|
*/
|
1411
|
|
- static void set_home_offset(AxisEnum axis, float v) {
|
|
1414
|
+ static void set_home_offset(const AxisEnum axis, const float v) {
|
1412
|
1415
|
current_position[axis] += v - home_offset[axis];
|
1413
|
1416
|
home_offset[axis] = v;
|
1414
|
1417
|
update_software_endstops(axis);
|