update code base to Marlin 2.0.9.2
This commit is contained in:
13
Marlin/src/gcode/probe/G30.cpp
Executable file → Normal file
13
Marlin/src/gcode/probe/G30.cpp
Executable file → Normal file
@@ -16,7 +16,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -46,22 +46,19 @@ void GcodeSuite::G30() {
|
||||
if (!probe.can_reach(pos)) return;
|
||||
|
||||
// Disable leveling so the planner won't mess with us
|
||||
#if HAS_LEVELING
|
||||
set_bed_leveling_enabled(false);
|
||||
#endif
|
||||
TERN_(HAS_LEVELING, set_bed_leveling_enabled(false));
|
||||
|
||||
remember_feedrate_scaling_off();
|
||||
|
||||
const ProbePtRaise raise_after = parser.boolval('E', true) ? PROBE_PT_STOW : PROBE_PT_NONE;
|
||||
const float measured_z = probe.probe_at_point(pos, raise_after, 1);
|
||||
if (!isnan(measured_z))
|
||||
SERIAL_ECHOLNPAIR("Bed X: ", FIXFLOAT(pos.x), " Y: ", FIXFLOAT(pos.y), " Z: ", FIXFLOAT(measured_z));
|
||||
SERIAL_ECHOLNPGM("Bed X: ", pos.x, " Y: ", pos.y, " Z: ", measured_z);
|
||||
|
||||
restore_feedrate_and_scaling();
|
||||
|
||||
#ifdef Z_AFTER_PROBING
|
||||
if (raise_after == PROBE_PT_STOW) probe.move_z_after_probing();
|
||||
#endif
|
||||
if (raise_after == PROBE_PT_STOW)
|
||||
probe.move_z_after_probing();
|
||||
|
||||
report_current_position();
|
||||
}
|
||||
|
2
Marlin/src/gcode/probe/G31_G32.cpp
Executable file → Normal file
2
Marlin/src/gcode/probe/G31_G32.cpp
Executable file → Normal file
@@ -16,7 +16,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
|
8
Marlin/src/gcode/probe/G38.cpp
Executable file → Normal file
8
Marlin/src/gcode/probe/G38.cpp
Executable file → Normal file
@@ -16,7 +16,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -38,7 +38,7 @@ inline void G38_single_probe(const uint8_t move_value) {
|
||||
planner.synchronize();
|
||||
G38_move = 0;
|
||||
endstops.hit_on_purpose();
|
||||
set_current_from_steppers_for_axis(ALL_AXES);
|
||||
set_current_from_steppers_for_axis(ALL_AXES_ENUM);
|
||||
sync_plan_position();
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ inline bool G38_run_probe() {
|
||||
#if MULTIPLE_PROBING > 1
|
||||
// Get direction of move and retract
|
||||
xyz_float_t retract_mm;
|
||||
LOOP_XYZ(i) {
|
||||
LOOP_LINEAR_AXES(i) {
|
||||
const float dist = destination[i] - current_position[i];
|
||||
retract_mm[i] = ABS(dist) < G38_MINIMUM_MOVE ? 0 : home_bump_mm((AxisEnum)i) * (dist > 0 ? -1 : 1);
|
||||
}
|
||||
@@ -119,7 +119,7 @@ void GcodeSuite::G38(const int8_t subcode) {
|
||||
;
|
||||
|
||||
// If any axis has enough movement, do the move
|
||||
LOOP_XYZ(i)
|
||||
LOOP_LINEAR_AXES(i)
|
||||
if (ABS(destination[i] - current_position[i]) >= G38_MINIMUM_MOVE) {
|
||||
if (!parser.seenval('F')) feedrate_mm_s = homing_feedrate((AxisEnum)i);
|
||||
// If G38.2 fails throw an error
|
||||
|
7
Marlin/src/gcode/probe/M401_M402.cpp
Executable file → Normal file
7
Marlin/src/gcode/probe/M401_M402.cpp
Executable file → Normal file
@@ -16,7 +16,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
*/
|
||||
void GcodeSuite::M401() {
|
||||
probe.deploy();
|
||||
TERN_(PROBE_TARE, probe.tare());
|
||||
report_current_position();
|
||||
}
|
||||
|
||||
@@ -41,9 +42,7 @@ void GcodeSuite::M401() {
|
||||
*/
|
||||
void GcodeSuite::M402() {
|
||||
probe.stow();
|
||||
#ifdef Z_AFTER_PROBING
|
||||
probe.move_z_after_probing();
|
||||
#endif
|
||||
probe.move_z_after_probing();
|
||||
report_current_position();
|
||||
}
|
||||
|
||||
|
45
Marlin/src/gcode/probe/M851.cpp
Executable file → Normal file
45
Marlin/src/gcode/probe/M851.cpp
Executable file → Normal file
@@ -16,7 +16,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -28,25 +28,12 @@
|
||||
#include "../../feature/bedlevel/bedlevel.h"
|
||||
#include "../../module/probe.h"
|
||||
|
||||
extern const char SP_Y_STR[], SP_Z_STR[];
|
||||
|
||||
/**
|
||||
* M851: Set the nozzle-to-probe offsets in current units
|
||||
*/
|
||||
void GcodeSuite::M851() {
|
||||
|
||||
// Show usage with no parameters
|
||||
if (!parser.seen("XYZ")) {
|
||||
SERIAL_ECHOLNPAIR_P(
|
||||
#if HAS_PROBE_XY_OFFSET
|
||||
PSTR(STR_PROBE_OFFSET " X"), probe.offset_xy.x, SP_Y_STR, probe.offset_xy.y, SP_Z_STR
|
||||
#else
|
||||
PSTR(STR_PROBE_OFFSET " X0 Y0 Z")
|
||||
#endif
|
||||
, probe.offset.z
|
||||
);
|
||||
return;
|
||||
}
|
||||
// No parameters? Show current state.
|
||||
if (!parser.seen("XYZ")) return M851_report();
|
||||
|
||||
// Start with current offsets and modify
|
||||
xyz_pos_t offs = probe.offset;
|
||||
@@ -60,11 +47,11 @@ void GcodeSuite::M851() {
|
||||
if (WITHIN(x, -(X_BED_SIZE), X_BED_SIZE))
|
||||
offs.x = x;
|
||||
else {
|
||||
SERIAL_ECHOLNPAIR("?X out of range (-", int(X_BED_SIZE), " to ", int(X_BED_SIZE), ")");
|
||||
SERIAL_ECHOLNPGM("?X out of range (-", X_BED_SIZE, " to ", X_BED_SIZE, ")");
|
||||
ok = false;
|
||||
}
|
||||
#else
|
||||
if (x) SERIAL_ECHOLNPAIR("?X must be 0 (NOZZLE_AS_PROBE)."); // ...but let 'ok' stay true
|
||||
if (x) SERIAL_ECHOLNPGM("?X must be 0 (NOZZLE_AS_PROBE)."); // ...but let 'ok' stay true
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -74,11 +61,11 @@ void GcodeSuite::M851() {
|
||||
if (WITHIN(y, -(Y_BED_SIZE), Y_BED_SIZE))
|
||||
offs.y = y;
|
||||
else {
|
||||
SERIAL_ECHOLNPAIR("?Y out of range (-", int(Y_BED_SIZE), " to ", int(Y_BED_SIZE), ")");
|
||||
SERIAL_ECHOLNPGM("?Y out of range (-", Y_BED_SIZE, " to ", Y_BED_SIZE, ")");
|
||||
ok = false;
|
||||
}
|
||||
#else
|
||||
if (y) SERIAL_ECHOLNPAIR("?Y must be 0 (NOZZLE_AS_PROBE)."); // ...but let 'ok' stay true
|
||||
if (y) SERIAL_ECHOLNPGM("?Y must be 0 (NOZZLE_AS_PROBE)."); // ...but let 'ok' stay true
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -87,7 +74,7 @@ void GcodeSuite::M851() {
|
||||
if (WITHIN(z, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX))
|
||||
offs.z = z;
|
||||
else {
|
||||
SERIAL_ECHOLNPAIR("?Z out of range (", int(Z_PROBE_OFFSET_RANGE_MIN), " to ", int(Z_PROBE_OFFSET_RANGE_MAX), ")");
|
||||
SERIAL_ECHOLNPGM("?Z out of range (", Z_PROBE_OFFSET_RANGE_MIN, " to ", Z_PROBE_OFFSET_RANGE_MAX, ")");
|
||||
ok = false;
|
||||
}
|
||||
}
|
||||
@@ -96,4 +83,20 @@ void GcodeSuite::M851() {
|
||||
if (ok) probe.offset = offs;
|
||||
}
|
||||
|
||||
void GcodeSuite::M851_report(const bool forReplay/*=true*/) {
|
||||
report_heading_etc(forReplay, PSTR(STR_Z_PROBE_OFFSET));
|
||||
SERIAL_ECHOPGM_P(
|
||||
#if HAS_PROBE_XY_OFFSET
|
||||
PSTR(" M851 X"), LINEAR_UNIT(probe.offset_xy.x),
|
||||
SP_Y_STR, LINEAR_UNIT(probe.offset_xy.y),
|
||||
SP_Z_STR
|
||||
#else
|
||||
PSTR(" M851 X0 Y0 Z")
|
||||
#endif
|
||||
, LINEAR_UNIT(probe.offset.z)
|
||||
, PSTR(" ;")
|
||||
);
|
||||
say_units();
|
||||
}
|
||||
|
||||
#endif // HAS_BED_PROBE
|
||||
|
24
Marlin/src/gcode/probe/M951.cpp
Executable file → Normal file
24
Marlin/src/gcode/probe/M951.cpp
Executable file → Normal file
@@ -16,7 +16,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -32,13 +32,13 @@ mpe_settings_t mpe_settings;
|
||||
|
||||
inline void mpe_settings_report() {
|
||||
SERIAL_ECHO_MSG("Magnetic Parking Extruder");
|
||||
SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("L: Left parking :", mpe_settings.parking_xpos[0]);
|
||||
SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("R: Right parking :", mpe_settings.parking_xpos[1]);
|
||||
SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("I: Grab Offset :", mpe_settings.grab_distance);
|
||||
SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("J: Normal speed :", long(MMS_TO_MMM(mpe_settings.slow_feedrate)));
|
||||
SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("H: High speed :", long(MMS_TO_MMM(mpe_settings.fast_feedrate)));
|
||||
SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("D: Distance trav.:", mpe_settings.travel_distance);
|
||||
SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("C: Compenstion :", mpe_settings.compensation_factor);
|
||||
SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("L: Left parking :", mpe_settings.parking_xpos[0]);
|
||||
SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("R: Right parking :", mpe_settings.parking_xpos[1]);
|
||||
SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("I: Grab Offset :", mpe_settings.grab_distance);
|
||||
SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("J: Normal speed :", long(MMS_TO_MMM(mpe_settings.slow_feedrate)));
|
||||
SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("H: High speed :", long(MMS_TO_MMM(mpe_settings.fast_feedrate)));
|
||||
SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("D: Distance trav.:", mpe_settings.travel_distance);
|
||||
SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("C: Compenstion :", mpe_settings.compensation_factor);
|
||||
}
|
||||
|
||||
void mpe_settings_init() {
|
||||
@@ -46,9 +46,7 @@ void mpe_settings_init() {
|
||||
mpe_settings.parking_xpos[0] = pex[0]; // M951 L
|
||||
mpe_settings.parking_xpos[1] = pex[1]; // M951 R
|
||||
mpe_settings.grab_distance = PARKING_EXTRUDER_GRAB_DISTANCE; // M951 I
|
||||
#if HAS_HOME_OFFSET
|
||||
set_home_offset(X_AXIS, mpe_settings.grab_distance * -1);
|
||||
#endif
|
||||
TERN_(HAS_HOME_OFFSET, set_home_offset(X_AXIS, mpe_settings.grab_distance * -1));
|
||||
mpe_settings.slow_feedrate = MMM_TO_MMS(MPE_SLOW_SPEED); // M951 J
|
||||
mpe_settings.fast_feedrate = MMM_TO_MMS(MPE_FAST_SPEED); // M951 H
|
||||
mpe_settings.travel_distance = MPE_TRAVEL_DISTANCE; // M951 D
|
||||
@@ -61,9 +59,7 @@ void GcodeSuite::M951() {
|
||||
if (parser.seenval('R')) mpe_settings.parking_xpos[1] = parser.value_linear_units();
|
||||
if (parser.seenval('I')) {
|
||||
mpe_settings.grab_distance = parser.value_linear_units();
|
||||
#if HAS_HOME_OFFSET
|
||||
set_home_offset(X_AXIS, mpe_settings.grab_distance * -1);
|
||||
#endif
|
||||
TERN_(HAS_HOME_OFFSET, set_home_offset(X_AXIS, mpe_settings.grab_distance * -1));
|
||||
}
|
||||
if (parser.seenval('J')) mpe_settings.slow_feedrate = MMM_TO_MMS(parser.value_linear_units());
|
||||
if (parser.seenval('H')) mpe_settings.fast_feedrate = MMM_TO_MMS(parser.value_linear_units());
|
||||
|
Reference in New Issue
Block a user