Skip to content

Commit

Permalink
Merge pull request #3782 from thinkyhead/rc_home_z_before_g29
Browse files Browse the repository at this point in the history
Require homing of Z before G29
  • Loading branch information
thinkyhead committed May 18, 2016
2 parents 552516d + a289707 commit d66e53c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
25 changes: 16 additions & 9 deletions Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2063,10 +2063,17 @@ static void setup_for_endstop_move() {
#endif // AUTO_BED_LEVELING_FEATURE

#if ENABLED(Z_PROBE_SLED) || ENABLED(Z_SAFE_HOMING) || ENABLED(AUTO_BED_LEVELING_FEATURE)
static void axis_unhomed_error() {
LCD_MESSAGEPGM(MSG_YX_UNHOMED);
SERIAL_ECHO_START;
SERIAL_ECHOLNPGM(MSG_YX_UNHOMED);
static void axis_unhomed_error(bool xyz=false) {
if (xyz) {
LCD_MESSAGEPGM(MSG_XYZ_UNHOMED);
SERIAL_ECHO_START;
SERIAL_ECHOLNPGM(MSG_XYZ_UNHOMED);
}
else {
LCD_MESSAGEPGM(MSG_YX_UNHOMED);
SERIAL_ECHO_START;
SERIAL_ECHOLNPGM(MSG_YX_UNHOMED);
}
}
#endif

Expand All @@ -2090,8 +2097,8 @@ static void setup_for_endstop_move() {
}
#endif

if (!axis_homed[X_AXIS] || !axis_homed[Y_AXIS]) {
axis_unhomed_error();
if (!axis_homed[X_AXIS] || !axis_homed[Y_AXIS] || !axis_homed[Z_AXIS]) {
axis_unhomed_error(true);
return;
}

Expand Down Expand Up @@ -3176,8 +3183,8 @@ inline void gcode_G28() {
#endif

// Don't allow auto-leveling without homing first
if (!axis_homed[X_AXIS] || !axis_homed[Y_AXIS]) {
axis_unhomed_error();
if (!axis_homed[X_AXIS] || !axis_homed[Y_AXIS] || !axis_homed[Z_AXIS]) {
axis_unhomed_error(true);
return;
}

Expand Down Expand Up @@ -4035,7 +4042,7 @@ inline void gcode_M42() {
inline void gcode_M48() {

if (!axis_homed[X_AXIS] || !axis_homed[Y_AXIS] || !axis_homed[Z_AXIS]) {
axis_unhomed_error();
axis_unhomed_error(true);
return;
}

Expand Down
3 changes: 3 additions & 0 deletions Marlin/language_en.h
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,9 @@
#ifndef MSG_YX_UNHOMED
#define MSG_YX_UNHOMED "Home X/Y before Z"
#endif
#ifndef MSG_XYZ_UNHOMED
#define MSG_XYZ_UNHOMED "Home XYZ first"
#endif
#ifndef MSG_ZPROBE_ZOFFSET
#define MSG_ZPROBE_ZOFFSET "Z Offset"
#endif
Expand Down

0 comments on commit d66e53c

Please sign in to comment.