Mark axes not-homed with HOME_AFTER_DEACTIVATE (#18907)

This commit is contained in:
swissnorp
2020-08-27 23:05:53 +02:00
committed by Scott Lahteine
parent d10f7eae31
commit 7d2e4481c7
20 changed files with 40 additions and 44 deletions

View File

@ -490,7 +490,7 @@ void GcodeSuite::G26() {
// Don't allow Mesh Validation without homing first,
// or if the parameter parsing did not go OK, abort
if (axis_unhomed_error()) return;
if (homing_needed_error()) return;
// Change the tool first, if specified
if (parser.seenval('T')) tool_change(parser.value_int());

View File

@ -183,7 +183,7 @@ G29_TYPE GcodeSuite::G29() {
faux = ENABLED(DEBUG_LEVELING_FEATURE) && DISABLED(PROBE_MANUALLY) ? parser.boolval('C') : no_action;
// Don't allow auto-leveling without homing first
if (axis_unhomed_error()) G29_RETURN(false);
if (homing_needed_error()) G29_RETURN(false);
if (!no_action && planner.leveling_active && parser.boolval('O')) { // Auto-level only if needed
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("> Auto-level not needed, skip");

View File

@ -118,7 +118,7 @@
DEBUG_SECTION(log_G28, "home_z_safely", DEBUGGING(LEVELING));
// Disallow Z homing if X or Y homing is needed
if (axis_unhomed_error(_BV(X_AXIS) | _BV(Y_AXIS))) return;
if (homing_needed_error(_BV(X_AXIS) | _BV(Y_AXIS))) return;
sync_plan_position();
@ -299,8 +299,8 @@ void GcodeSuite::G28() {
#else // NOT DELTA
const bool homeZ = parser.seen('Z'),
needX = homeZ && TERN0(Z_SAFE_HOMING, axes_need_homing(_BV(X_AXIS))),
needY = homeZ && TERN0(Z_SAFE_HOMING, axes_need_homing(_BV(Y_AXIS))),
needX = homeZ && TERN0(Z_SAFE_HOMING, axes_should_home(_BV(X_AXIS))),
needY = homeZ && TERN0(Z_SAFE_HOMING, axes_should_home(_BV(Y_AXIS))),
homeX = needX || parser.seen('X'), homeY = needY || parser.seen('Y'),
home_all = homeX == homeY && homeX == homeZ, // All or None
doX = home_all || homeX, doY = home_all || homeY, doZ = home_all || homeZ;

View File

@ -584,7 +584,7 @@ void GcodeSuite::G425() {
TEMPORARY_SOFT_ENDSTOP_STATE(false);
TEMPORARY_BED_LEVELING_STATE(false);
if (axis_unhomed_error()) return;
if (homing_needed_error()) return;
measurements_t m;

View File

@ -55,7 +55,7 @@ extern const char SP_Y_STR[];
void GcodeSuite::M48() {
if (axis_unhomed_error()) return;
if (homing_needed_error()) return;
const int8_t verbose_level = parser.byteval('V', 1);
if (!WITHIN(verbose_level, 0, 4)) {

View File

@ -126,7 +126,7 @@ void GcodeSuite::M240() {
#ifdef PHOTO_POSITION
if (axis_unhomed_error()) return;
if (homing_needed_error()) return;
const xyz_pos_t old_pos = {
current_position.x + parser.linearval('A'),

View File

@ -45,7 +45,7 @@
*/
void GcodeSuite::G12() {
// Don't allow nozzle cleaning without homing first
if (axis_unhomed_error()) return;
if (homing_needed_error()) return;
#ifdef WIPE_SEQUENCE_COMMANDS
if (!parser.seen_any()) {

View File

@ -34,7 +34,7 @@
*/
void GcodeSuite::G27() {
// Don't allow nozzle parking without homing first
if (axis_unhomed_error()) return;
if (homing_needed_error()) return;
nozzle.park(parser.ushortval('P'));
}

View File

@ -61,7 +61,7 @@ void GcodeSuite::M701() {
#if ENABLED(NO_MOTION_BEFORE_HOMING)
// Don't raise Z if the machine isn't homed
if (axes_need_homing()) park_point.z = 0;
if (axes_should_home()) park_point.z = 0;
#endif
#if ENABLED(MIXING_EXTRUDER)
@ -149,7 +149,7 @@ void GcodeSuite::M702() {
#if ENABLED(NO_MOTION_BEFORE_HOMING)
// Don't raise Z if the machine isn't homed
if (axes_need_homing()) park_point.z = 0;
if (axes_should_home()) park_point.z = 0;
#endif
#if ENABLED(MIXING_EXTRUDER)

View File

@ -61,7 +61,7 @@ void GcodeSuite::M206() {
* Use M206 to set these values directly.
*/
void GcodeSuite::M428() {
if (axis_unhomed_error()) return;
if (homing_needed_error()) return;
xyz_float_t diff;
LOOP_XYZ(i) {

View File

@ -52,7 +52,7 @@ void GcodeSuite::G0_G1(
if (IsRunning()
#if ENABLED(NO_MOTION_BEFORE_HOMING)
&& !axis_unhomed_error(
&& !homing_needed_error(
(parser.seen('X') ? _BV(X_AXIS) : 0)
| (parser.seen('Y') ? _BV(Y_AXIS) : 0)
| (parser.seen('Z') ? _BV(Z_AXIS) : 0) )