Browse Source

Prevent G29 without first homing in X and Y

If position is unknown, then G29 can be dangerous.
Gabe Rosenhouse 11 years ago
parent
commit
357e31270a
1 changed files with 9 additions and 0 deletions
  1. 9
    0
      Marlin/Marlin_main.cpp

+ 9
- 0
Marlin/Marlin_main.cpp View File

1409
             #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."
1409
             #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."
1410
             #endif
1410
             #endif
1411
 
1411
 
1412
+            // Prevent user from running a G29 without first homing in X and Y
1413
+            if (! (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) )
1414
+            {
1415
+                LCD_MESSAGEPGM(MSG_POSITION_UNKNOWN);
1416
+                SERIAL_ECHO_START;
1417
+                SERIAL_ECHOLNPGM(MSG_POSITION_UNKNOWN);
1418
+                break; // abort G29, since we don't know where we are
1419
+            }
1420
+
1412
             st_synchronize();
1421
             st_synchronize();
1413
             // make sure the bed_level_rotation_matrix is identity or the planner will get it incorectly
1422
             // make sure the bed_level_rotation_matrix is identity or the planner will get it incorectly
1414
             //vector_3 corrected_position = plan_get_position_mm();
1423
             //vector_3 corrected_position = plan_get_position_mm();

Loading…
Cancel
Save