Browse Source

Add Z_PROBE_END_SCRIPT to UBL (#14419)

InsanityAutomation 5 years ago
parent
commit
b961251899
1 changed files with 12 additions and 0 deletions
  1. 12
    0
      Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp

+ 12
- 0
Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp View File

@@ -306,6 +306,7 @@
306 306
 
307 307
   void unified_bed_leveling::G29() {
308 308
 
309
+    bool probe_deployed = false;
309 310
     if (g29_parameter_parsing()) return; // Abort on parameter error
310 311
 
311 312
     const int8_t p_val = parser.intval('P', -1);
@@ -418,6 +419,7 @@
418 419
         }
419 420
         do_blocking_move_to_xy(0.5f * (MESH_MAX_X - (MESH_MIN_X)), 0.5f * (MESH_MAX_Y - (MESH_MIN_Y)));
420 421
         report_current_position();
422
+        probe_deployed = true;
421 423
       }
422 424
 
423 425
     #endif // HAS_BED_PROBE
@@ -457,6 +459,7 @@
457 459
                               parser.seen('T'), parser.seen('E'), parser.seen('U'));
458 460
 
459 461
             report_current_position();
462
+            probe_deployed = true;
460 463
             break;
461 464
 
462 465
         #endif // HAS_BED_PROBE
@@ -492,6 +495,7 @@
492 495
                 SERIAL_ECHOLNPGM("?Error in Business Card measurement.");
493 496
                 return;
494 497
               }
498
+              probe_deployed = true;
495 499
             }
496 500
 
497 501
             if (!position_is_reachable(g29_x_pos, g29_y_pos)) {
@@ -671,6 +675,14 @@
671 675
       ui.release();
672 676
     #endif
673 677
 
678
+    #ifdef Z_PROBE_END_SCRIPT
679
+      if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Z Probe End Script: ", Z_PROBE_END_SCRIPT);
680
+      if (probe_deployed) {
681
+        planner.synchronize();
682
+        process_subcommands_now_P(PSTR(Z_PROBE_END_SCRIPT));
683
+      }
684
+    #endif
685
+
674 686
     return;
675 687
   }
676 688
 

Loading…
Cancel
Save