浏览代码

Merge pull request #6736 from thinkyhead/bf_axis_unhomed

More constraint on axis_unhomed_error
Scott Lahteine 8 年前
父节点
当前提交
b17bcd56da
共有 4 个文件被更改,包括 19 次插入21 次删除
  1. 1
    1
      Marlin/G26_Mesh_Validation_Tool.cpp
  2. 1
    1
      Marlin/Marlin.h
  3. 16
    18
      Marlin/Marlin_main.cpp
  4. 1
    1
      Marlin/ubl_G29.cpp

+ 1
- 1
Marlin/G26_Mesh_Validation_Tool.cpp 查看文件

@@ -201,7 +201,7 @@
201 201
 
202 202
     // Don't allow Mesh Validation without homing first,
203 203
     // or if the parameter parsing did not go OK, abort
204
-    if (axis_unhomed_error(true, true, true) || parse_G26_parameters()) return;
204
+    if (axis_unhomed_error() || parse_G26_parameters()) return;
205 205
 
206 206
     if (current_position[Z_AXIS] < Z_CLEARANCE_BETWEEN_PROBES) {
207 207
       do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);

+ 1
- 1
Marlin/Marlin.h 查看文件

@@ -426,7 +426,7 @@ void do_blocking_move_to_z(const float &z, const float &fr_mm_s=0.0);
426 426
 void do_blocking_move_to_xy(const float &x, const float &y, const float &fr_mm_s=0.0);
427 427
 
428 428
 #if ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) || HAS_PROBING_PROCEDURE || HOTENDS > 1 || ENABLED(NOZZLE_CLEAN_FEATURE) || ENABLED(NOZZLE_PARK_FEATURE)
429
-  bool axis_unhomed_error(const bool x, const bool y, const bool z);
429
+  bool axis_unhomed_error(const bool x=true, const bool y=true, const bool z=true);
430 430
 #endif
431 431
 
432 432
 /**

+ 16
- 18
Marlin/Marlin_main.cpp 查看文件

@@ -1851,10 +1851,10 @@ static void clean_up_after_endstop_or_probe_move() {
1851 1851
 
1852 1852
 #if HAS_PROBING_PROCEDURE || HOTENDS > 1 || ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) || ENABLED(NOZZLE_CLEAN_FEATURE) || ENABLED(NOZZLE_PARK_FEATURE) || ENABLED(DELTA_AUTO_CALIBRATION)
1853 1853
 
1854
-  bool axis_unhomed_error(const bool x, const bool y, const bool z) {
1855
-    const bool xx = x && !axis_homed[X_AXIS],
1856
-               yy = y && !axis_homed[Y_AXIS],
1857
-               zz = z && !axis_homed[Z_AXIS];
1854
+  bool axis_unhomed_error(const bool x/*=true*/, const bool y/*=true*/, const bool z/*=true*/) {
1855
+    const bool xx = x && !axis_known_position[X_AXIS],
1856
+               yy = y && !axis_known_position[Y_AXIS],
1857
+               zz = z && !axis_known_position[Z_AXIS];
1858 1858
     if (xx || yy || zz) {
1859 1859
       SERIAL_ECHO_START;
1860 1860
       SERIAL_ECHOPGM(MSG_HOME " ");
@@ -2169,15 +2169,13 @@ static void clean_up_after_endstop_or_probe_move() {
2169 2169
           return true;
2170 2170
         }
2171 2171
       }
2172
-    #elif ENABLED(Z_PROBE_SLED)
2173
-      if (axis_unhomed_error(true, false, false)) {
2174
-        SERIAL_ERROR_START;
2175
-        SERIAL_ERRORLNPGM(MSG_STOP_UNHOMED);
2176
-        stop();
2177
-        return true;
2178
-      }
2179
-    #elif ENABLED(Z_PROBE_ALLEN_KEY)
2180
-      if (axis_unhomed_error(true, true,  true )) {
2172
+    #elif ENABLED(Z_PROBE_SLED) || ENABLED(Z_PROBE_ALLEN_KEY)
2173
+      #if ENABLED(Z_PROBE_SLED)
2174
+        #define _AUE_ARGS true, false, false
2175
+      #else
2176
+        #define _AUE_ARGS
2177
+      #endif
2178
+      if (axis_unhomed_error(_AUE_ARGS)) {
2181 2179
         SERIAL_ERROR_START;
2182 2180
         SERIAL_ERRORLNPGM(MSG_STOP_UNHOMED);
2183 2181
         stop();
@@ -3414,7 +3412,7 @@ inline void gcode_G4() {
3414 3412
    */
3415 3413
   inline void gcode_G12() {
3416 3414
     // Don't allow nozzle cleaning without homing first
3417
-    if (axis_unhomed_error(true, true, true)) return;
3415
+    if (axis_unhomed_error()) return;
3418 3416
 
3419 3417
     const uint8_t pattern = code_seen('P') ? code_value_ushort() : 0,
3420 3418
                   strokes = code_seen('S') ? code_value_ushort() : NOZZLE_CLEAN_STROKES,
@@ -3443,7 +3441,7 @@ inline void gcode_G4() {
3443 3441
    */
3444 3442
   inline void gcode_G27() {
3445 3443
     // Don't allow nozzle parking without homing first
3446
-    if (axis_unhomed_error(true, true, true)) return;
3444
+    if (axis_unhomed_error()) return;
3447 3445
     Nozzle::park(code_seen('P') ? code_value_ushort() : 0);
3448 3446
   }
3449 3447
 #endif // NOZZLE_PARK_FEATURE
@@ -4222,7 +4220,7 @@ void home_all_axes() { gcode_G28(); }
4222 4220
     #endif
4223 4221
 
4224 4222
     // Don't allow auto-leveling without homing first
4225
-    if (axis_unhomed_error(true, true, true)) return;
4223
+    if (axis_unhomed_error()) return;
4226 4224
 
4227 4225
     // Define local vars 'static' for manual probing, 'auto' otherwise
4228 4226
     #if ENABLED(PROBE_MANUALLY)
@@ -6174,7 +6172,7 @@ inline void gcode_M42() {
6174 6172
    */
6175 6173
   inline void gcode_M48() {
6176 6174
 
6177
-    if (axis_unhomed_error(true, true, true)) return;
6175
+    if (axis_unhomed_error()) return;
6178 6176
 
6179 6177
     const int8_t verbose_level = code_seen('V') ? code_value_byte() : 1;
6180 6178
     if (!WITHIN(verbose_level, 0, 4)) {
@@ -9427,7 +9425,7 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
9427 9425
       feedrate_mm_s = fr_mm_s > 0.0 ? fr_mm_s : XY_PROBE_FEEDRATE_MM_S;
9428 9426
 
9429 9427
       if (tmp_extruder != active_extruder) {
9430
-        if (!no_move && axis_unhomed_error(true, true, true)) {
9428
+        if (!no_move && axis_unhomed_error()) {
9431 9429
           SERIAL_ECHOLNPGM("No move on toolchange");
9432 9430
           no_move = true;
9433 9431
         }

+ 1
- 1
Marlin/ubl_G29.cpp 查看文件

@@ -329,7 +329,7 @@
329 329
     }
330 330
 
331 331
     // Don't allow auto-leveling without homing first
332
-    if (!code_seen('N') && axis_unhomed_error(true, true, true)) // Warning! Use of 'N' flouts established standards.
332
+    if (!(code_seen('N') && code_value_bool()) && axis_unhomed_error()) // Warning! Use of 'N' flouts established standards.
333 333
       home_all_axes();
334 334
 
335 335
     if (g29_parameter_parsing()) return; // abort if parsing the simple parameters causes a problem,

正在加载...
取消
保存