Add custom types for position (#15204)
This commit is contained in:
@ -58,7 +58,7 @@ void GcodeSuite::M125() {
|
||||
#endif
|
||||
);
|
||||
|
||||
point_t park_point = NOZZLE_PARK_POINT;
|
||||
xyz_pos_t park_point = NOZZLE_PARK_POINT;
|
||||
|
||||
// Move XY axes to filament change position or given position
|
||||
if (parser.seenval('X')) park_point.x = RAW_X_POSITION(parser.linearval('X'));
|
||||
@ -68,8 +68,7 @@ void GcodeSuite::M125() {
|
||||
if (parser.seenval('Z')) park_point.z = parser.linearval('Z');
|
||||
|
||||
#if HAS_HOTEND_OFFSET && NONE(DUAL_X_CARRIAGE, DELTA)
|
||||
park_point.x += hotend_offset[X_AXIS][active_extruder];
|
||||
park_point.y += hotend_offset[Y_AXIS][active_extruder];
|
||||
park_point += hotend_offset[active_extruder];
|
||||
#endif
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
|
@ -60,7 +60,6 @@
|
||||
* Default values are used for omitted arguments.
|
||||
*/
|
||||
void GcodeSuite::M600() {
|
||||
point_t park_point = NOZZLE_PARK_POINT;
|
||||
|
||||
#if ENABLED(MIXING_EXTRUDER)
|
||||
const int8_t target_e_stepper = get_target_e_stepper_from_command();
|
||||
@ -119,6 +118,8 @@ void GcodeSuite::M600() {
|
||||
#endif
|
||||
);
|
||||
|
||||
xyz_pos_t park_point NOZZLE_PARK_POINT;
|
||||
|
||||
// Lift Z axis
|
||||
if (parser.seenval('Z')) park_point.z = parser.linearval('Z');
|
||||
|
||||
@ -127,8 +128,7 @@ void GcodeSuite::M600() {
|
||||
if (parser.seenval('Y')) park_point.y = parser.linearval('Y');
|
||||
|
||||
#if HAS_HOTEND_OFFSET && NONE(DUAL_X_CARRIAGE, DELTA)
|
||||
park_point.x += hotend_offset[X_AXIS][active_extruder];
|
||||
park_point.y += hotend_offset[Y_AXIS][active_extruder];
|
||||
park_point += hotend_offset[active_extruder];
|
||||
#endif
|
||||
|
||||
#if ENABLED(MMU2_MENUS)
|
||||
|
@ -28,7 +28,6 @@
|
||||
#include "../../../Marlin.h"
|
||||
#include "../../../module/motion.h"
|
||||
#include "../../../module/temperature.h"
|
||||
#include "../../../libs/point_t.h"
|
||||
|
||||
#if EXTRUDERS > 1
|
||||
#include "../../../module/tool_change.h"
|
||||
@ -57,7 +56,7 @@
|
||||
* Default values are used for omitted arguments.
|
||||
*/
|
||||
void GcodeSuite::M701() {
|
||||
point_t park_point = NOZZLE_PARK_POINT;
|
||||
xyz_pos_t park_point = NOZZLE_PARK_POINT;
|
||||
|
||||
#if ENABLED(NO_MOTION_BEFORE_HOMING)
|
||||
// Don't raise Z if the machine isn't homed
|
||||
@ -97,7 +96,7 @@ void GcodeSuite::M701() {
|
||||
|
||||
// Lift Z axis
|
||||
if (park_point.z > 0)
|
||||
do_blocking_move_to_z(_MIN(current_position[Z_AXIS] + park_point.z, Z_MAX_POS), feedRate_t(NOZZLE_PARK_Z_FEEDRATE));
|
||||
do_blocking_move_to_z(_MIN(current_position.z + park_point.z, Z_MAX_POS), feedRate_t(NOZZLE_PARK_Z_FEEDRATE));
|
||||
|
||||
// Load filament
|
||||
#if ENABLED(PRUSA_MMU2)
|
||||
@ -116,7 +115,7 @@ void GcodeSuite::M701() {
|
||||
|
||||
// Restore Z axis
|
||||
if (park_point.z > 0)
|
||||
do_blocking_move_to_z(_MAX(current_position[Z_AXIS] - park_point.z, 0), feedRate_t(NOZZLE_PARK_Z_FEEDRATE));
|
||||
do_blocking_move_to_z(_MAX(current_position.z - park_point.z, 0), feedRate_t(NOZZLE_PARK_Z_FEEDRATE));
|
||||
|
||||
#if EXTRUDERS > 1 && DISABLED(PRUSA_MMU2)
|
||||
// Restore toolhead if it was changed
|
||||
@ -146,7 +145,7 @@ void GcodeSuite::M701() {
|
||||
* Default values are used for omitted arguments.
|
||||
*/
|
||||
void GcodeSuite::M702() {
|
||||
point_t park_point = NOZZLE_PARK_POINT;
|
||||
xyz_pos_t park_point = NOZZLE_PARK_POINT;
|
||||
|
||||
#if ENABLED(NO_MOTION_BEFORE_HOMING)
|
||||
// Don't raise Z if the machine isn't homed
|
||||
@ -196,7 +195,7 @@ void GcodeSuite::M702() {
|
||||
|
||||
// Lift Z axis
|
||||
if (park_point.z > 0)
|
||||
do_blocking_move_to_z(_MIN(current_position[Z_AXIS] + park_point.z, Z_MAX_POS), feedRate_t(NOZZLE_PARK_Z_FEEDRATE));
|
||||
do_blocking_move_to_z(_MIN(current_position.z + park_point.z, Z_MAX_POS), feedRate_t(NOZZLE_PARK_Z_FEEDRATE));
|
||||
|
||||
// Unload filament
|
||||
#if ENABLED(PRUSA_MMU2)
|
||||
@ -226,7 +225,7 @@ void GcodeSuite::M702() {
|
||||
|
||||
// Restore Z axis
|
||||
if (park_point.z > 0)
|
||||
do_blocking_move_to_z(_MAX(current_position[Z_AXIS] - park_point.z, 0), feedRate_t(NOZZLE_PARK_Z_FEEDRATE));
|
||||
do_blocking_move_to_z(_MAX(current_position.z - park_point.z, 0), feedRate_t(NOZZLE_PARK_Z_FEEDRATE));
|
||||
|
||||
#if EXTRUDERS > 1 && DISABLED(PRUSA_MMU2)
|
||||
// Restore toolhead if it was changed
|
||||
|
Reference in New Issue
Block a user