defaulting to 91 fw
inverting x/y changing hotendfan port
This commit is contained in:
@@ -32,8 +32,19 @@
|
||||
* M851: Set the nozzle-to-probe offsets in current units
|
||||
*/
|
||||
void GcodeSuite::M851() {
|
||||
// No parameters? Show current state.
|
||||
if (!parser.seen("XYZ")) return M851_report();
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
// Start with current offsets and modify
|
||||
xyz_pos_t offs = probe.offset;
|
||||
@@ -47,11 +58,11 @@ void GcodeSuite::M851() {
|
||||
if (WITHIN(x, -(X_BED_SIZE), X_BED_SIZE))
|
||||
offs.x = x;
|
||||
else {
|
||||
SERIAL_ECHOLNPGM("?X out of range (-", X_BED_SIZE, " to ", X_BED_SIZE, ")");
|
||||
SERIAL_ECHOLNPAIR("?X out of range (-", X_BED_SIZE, " to ", X_BED_SIZE, ")");
|
||||
ok = false;
|
||||
}
|
||||
#else
|
||||
if (x) SERIAL_ECHOLNPGM("?X must be 0 (NOZZLE_AS_PROBE)."); // ...but let 'ok' stay true
|
||||
if (x) SERIAL_ECHOLNPAIR("?X must be 0 (NOZZLE_AS_PROBE)."); // ...but let 'ok' stay true
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -61,11 +72,11 @@ void GcodeSuite::M851() {
|
||||
if (WITHIN(y, -(Y_BED_SIZE), Y_BED_SIZE))
|
||||
offs.y = y;
|
||||
else {
|
||||
SERIAL_ECHOLNPGM("?Y out of range (-", Y_BED_SIZE, " to ", Y_BED_SIZE, ")");
|
||||
SERIAL_ECHOLNPAIR("?Y out of range (-", Y_BED_SIZE, " to ", Y_BED_SIZE, ")");
|
||||
ok = false;
|
||||
}
|
||||
#else
|
||||
if (y) SERIAL_ECHOLNPGM("?Y must be 0 (NOZZLE_AS_PROBE)."); // ...but let 'ok' stay true
|
||||
if (y) SERIAL_ECHOLNPAIR("?Y must be 0 (NOZZLE_AS_PROBE)."); // ...but let 'ok' stay true
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -74,7 +85,7 @@ void GcodeSuite::M851() {
|
||||
if (WITHIN(z, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX))
|
||||
offs.z = z;
|
||||
else {
|
||||
SERIAL_ECHOLNPGM("?Z out of range (", Z_PROBE_OFFSET_RANGE_MIN, " to ", Z_PROBE_OFFSET_RANGE_MAX, ")");
|
||||
SERIAL_ECHOLNPAIR("?Z out of range (", Z_PROBE_OFFSET_RANGE_MIN, " to ", Z_PROBE_OFFSET_RANGE_MAX, ")");
|
||||
ok = false;
|
||||
}
|
||||
}
|
||||
@@ -83,20 +94,4 @@ 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)
|
||||
, " ;"
|
||||
);
|
||||
say_units();
|
||||
}
|
||||
|
||||
#endif // HAS_BED_PROBE
|
||||
|
||||
Reference in New Issue
Block a user