Add custom types for position (#15204)
This commit is contained in:
@ -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