Skip to content

Commit

Permalink
Prevent G29 without first homing in X and Y
Browse files Browse the repository at this point in the history
If position is unknown, then G29 can be dangerous.
  • Loading branch information
Gabe Rosenhouse committed Feb 19, 2014
1 parent abba7a0 commit 357e312
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1409,6 +1409,15 @@ void process_commands()
#error "You must have a Z_MIN endstop in order to enable Auto Bed Leveling feature!!! Z_MIN_PIN must point to a valid hardware pin."
#endif

// Prevent user from running a G29 without first homing in X and Y
if (! (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) )
{
LCD_MESSAGEPGM(MSG_POSITION_UNKNOWN);
SERIAL_ECHO_START;
SERIAL_ECHOLNPGM(MSG_POSITION_UNKNOWN);
break; // abort G29, since we don't know where we are
}

st_synchronize();
// make sure the bed_level_rotation_matrix is identity or the planner will get it incorectly
//vector_3 corrected_position = plan_get_position_mm();
Expand Down

0 comments on commit 357e312

Please sign in to comment.