Browse Source

Merge branch 'Marlin_v1' of https://github.com/ErikZalm/Marlin into typofixes_upstream

Cylindric 11 years ago
parent
commit
541155ea87
1 changed files with 12 additions and 3 deletions
  1. 12
    3
      Marlin/Marlin_main.cpp

+ 12
- 3
Marlin/Marlin_main.cpp View File

@@ -76,7 +76,7 @@
76 76
 // G10 - retract filament according to settings of M207
77 77
 // G11 - retract recover filament according to settings of M208
78 78
 // G28 - Home all Axis
79
-// G29 - Detailed Z-Probe, probes the bed at 3 points.  You must de at the home position for this to work correctly.
79
+// G29 - Detailed Z-Probe, probes the bed at 3 or more points.  Will fail if you haven't homed yet.
80 80
 // G30 - Single Z Probe, probes bed at current XY location.
81 81
 // G90 - Use Absolute Coordinates
82 82
 // G91 - Use Relative Coordinates
@@ -1241,7 +1241,7 @@ void process_commands()
1241 1241
 
1242 1242
 #else // NOT DELTA
1243 1243
 
1244
-      home_all_axis = !((code_seen(axis_codes[0])) || (code_seen(axis_codes[1])) || (code_seen(axis_codes[2])));
1244
+      home_all_axis = !((code_seen(axis_codes[X_AXIS])) || (code_seen(axis_codes[Y_AXIS])) || (code_seen(axis_codes[Z_AXIS])));
1245 1245
 
1246 1246
       #if Z_HOME_DIR > 0                      // If homing away from BED do Z first
1247 1247
       if((home_all_axis) || (code_seen(axis_codes[Z_AXIS]))) {
@@ -1409,6 +1409,15 @@ void process_commands()
1409 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 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 1421
             st_synchronize();
1413 1422
             // make sure the bed_level_rotation_matrix is identity or the planner will get it incorectly
1414 1423
             //vector_3 corrected_position = plan_get_position_mm();
@@ -2088,7 +2097,7 @@ void process_commands()
2088 2097
       }
2089 2098
       else
2090 2099
       {
2091
-        bool all_axis = !((code_seen(axis_codes[0])) || (code_seen(axis_codes[1])) || (code_seen(axis_codes[2]))|| (code_seen(axis_codes[3])));
2100
+        bool all_axis = !((code_seen(axis_codes[X_AXIS])) || (code_seen(axis_codes[Y_AXIS])) || (code_seen(axis_codes[Z_AXIS]))|| (code_seen(axis_codes[E_AXIS])));
2092 2101
         if(all_axis)
2093 2102
         {
2094 2103
           st_synchronize();

Loading…
Cancel
Save